aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/pom.xml
blob: 6bf8a3632959bc5459e73dbd9ab9d41dc218bfd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<?xml version="1.0"?>
<project
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
  xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>

  <!-- This is the Maven project object model (POM) file for VID web application
      based on the ECOMP SDK distribution. This file stands alone; it does not
      inherit from a parent maven module. -->
  <groupId>org.onap.vid</groupId>
  <artifactId>vid-webpack-master</artifactId>
  <version>8.0.2-SNAPSHOT</version>
  <packaging>war</packaging>
  <name>VID UI</name>
  <description>VID UI</description>

  <properties>
    <encoding>UTF-8</encoding>
    <!--<springframework.version>5.1.6.RELEASE</springframework.version>-->
    <!--<hibernate.version>4.3.11.Final</hibernate.version>-->
    <!-- Skip assembling the zip by default -->
    <skipassembly>true</skipassembly>
    <!-- Tests usually require some setup that maven cannot do, so skip. -->
    <skiptests>false</skiptests>
    <!-- this should be commented for local debugging -->
    <!-- <deployenv>local</deployenv> -->
    <nexusproxy>https://nexus.onap.org</nexusproxy>
    <stagingNexusPath>content/repositories/staging/</stagingNexusPath>
    <snapshotNexusPath>content/repositories/snapshots/</snapshotNexusPath>
    <releaseNexusPath>content/repositories/releases/</releaseNexusPath>

    <eirslett.version>1.9.1</eirslett.version>
    <node.version>v10.19.0</node.version>
    <npm.version>6.14.4</npm.version>

    <NPM_CMD>ci</NPM_CMD>
  </properties>


  <repositories>
    <repository>
      <id>onap-staging</id>
      <name>ONAP - Staging Repository</name>
      <url>${nexusproxy}/${stagingNexusPath}</url>
    </repository>
    <repository>
      <id>ecomp-releases</id>
      <name>OpenECOMP - Release Repository</name>
      <url>${nexusproxy}/${releaseNexusPath}</url>
    </repository>
    <repository>
      <id>ecomp-snapshots</id>
      <name>OpenECOMP - Snapshot Repository</name>
      <url>${nexusproxy}/${snapshotNexusPath}</url>
    </repository>
    <repository>
      <id>ecomp-public</id>
      <name>ecomp onap public Repository</name>
      <url>https://nexus.onap.org/content/groups/public</url>
    </repository>
  </repositories>

  <distributionManagement>
    <repository>
      <id>ecomp-releases</id>
      <name>VID Release Repository</name>
      <url>${nexusproxy}/${releaseNexusPath}</url>
    </repository>
    <snapshotRepository>
      <id>ecomp-snapshots</id>
      <name>VID Snapshot Repository</name>
      <url>${nexusproxy}/${snapshotNexusPath}</url>
    </snapshotRepository>

  </distributionManagement>

  <profiles>

    <profile>
      <id>if-not-webpack</id>
      <activation>
        <property>
          <name>skipModernUi</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.8</version>
            <executions>
              <execution>
                <id>make-empty-dist</id>
                <phase>validate</phase>
                <configuration>
                  <target>
                    <mkdir dir="${project.basedir}/dist/"/>
                    <echo file="${project.basedir}/dist/NO-WEBPACK.txt" append="false">
                      Note: 'webpack' profile was not selected while mvn build. This 'dist' folder was created to make
                      the war creation through.
                    </echo>
                  </target>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

        </plugins>
      </build>
    </profile>

    <profile>
      <id>webpack-npm</id>
      <activation>
        <property>
          <name>skipModernUi</name>
          <value>!true</value>
        </property>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
            <!-- NB! Set <version> to the latest released version of frontend-maven-plugin, like in README.md -->
            <version>${eirslett.version}</version>

            <executions>

              <execution>
                <id>install node and npm</id>
                <goals>
                  <goal>install-node-and-npm</goal>
                </goals>
                <configuration>
                  <!-- See https://nodejs.org/en/download/ for latest node and npm (lts) versions -->
                  <npmVersion>${npm.version}</npmVersion>
                  <nodeVersion>${node.version}</nodeVersion>
                </configuration>
              </execution>

              <execution>
                <id>npm install</id>
                <goals>
                  <goal>npm</goal>
                </goals>
                <!-- Optional configuration which provides for running any npm command -->
                <configuration>
                  <arguments>install</arguments>
                  <environmentVariables>
                    <CYPRESS_INSTALL_BINARY>0</CYPRESS_INSTALL_BINARY>
                  </environmentVariables>
                </configuration>
              </execution>

              <execution>
                <id>npm run</id>
                <goals>
                  <goal>npm</goal>
                </goals>
                <configuration>
                  <arguments>run ${NPM_CMD}</arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>cypress</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
            <!-- NB! Set <version> to the latest released version of frontend-maven-plugin, like in README.md -->
            <version>${eirslett.version}</version>

            <executions>

              <execution>
                <id>install node and npm</id>
                <goals>
                  <goal>install-node-and-npm</goal>
                </goals>
                <configuration>
                  <!-- See https://nodejs.org/en/download/ for latest node and npm (lts) versions -->
                  <npmVersion>${npm.version}</npmVersion>
                  <nodeVersion>${node.version}</nodeVersion>
                </configuration>
              </execution>

              <execution>
                <id>npm install cypress</id>
                <goals>
                  <goal>npm</goal>
                </goals>
                <!-- Optional configuration which provides for running any npm command -->
                <configuration>
                  <arguments>install --verbose cypress @bahmutov/add-typescript-to-cypress</arguments>
                </configuration>
              </execution>

              <execution>
                <id>npm run cypress</id>
                <goals>
                  <goal>npm</goal>
                </goals>
                <configuration>
                  <npmInheritsProxyConfigFromMaven>false</npmInheritsProxyConfigFromMaven>
                  <arguments>run cypress:run -- --config baseUrl=http://${VID_HOST}:8080/vid</arguments>
                </configuration>
              </execution>

            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <finalName>vid-webpack-master</finalName>
    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.2.3</version>
        <configuration>
          <webResources>
            <resource>
              <!-- this is relative to the pom.xml directory -->
              <directory>dist</directory>
              <targetPath>app/ui</targetPath>
            </resource>
          </webResources>
          <webXml>src/WEB-INF/web.xml</webXml>
        </configuration>
      </plugin>
    <plugin>
      <artifactId>maven-clean-plugin</artifactId>
      <configuration>
        <filesets>
          <fileset>
            <directory>dist</directory>
          </fileset>
        </filesets>
      </configuration>
    </plugin>
    </plugins>
  </build>
  <dependencies>
  </dependencies>
</project>