9e7dd0da6ac70bd7aabf346157224ad6c084f04d
[vid.git] / vid-webpack-master / pom.xml
1 <?xml version="1.0"?>
2 <project
3   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
4   xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
5   <modelVersion>4.0.0</modelVersion>
6
7   <!-- This is the Maven project object model (POM) file for VID web application
8       based on the ECOMP SDK distribution. This file stands alone; it does not
9       inherit from a parent maven module. -->
10   <groupId>org.onap.vid</groupId>
11   <artifactId>vid-webpack-master</artifactId>
12   <version>5.0.3-SNAPSHOT</version>
13   <packaging>war</packaging>
14   <name>VID UI</name>
15   <description>VID UI</description>
16
17   <properties>
18     <encoding>UTF-8</encoding>
19     <!--<springframework.version>5.1.6.RELEASE</springframework.version>-->
20     <!--<hibernate.version>4.3.11.Final</hibernate.version>-->
21     <!-- Skip assembling the zip by default -->
22     <skipassembly>true</skipassembly>
23     <!-- Tests usually require some setup that maven cannot do, so skip. -->
24     <skiptests>false</skiptests>
25     <!-- this should be commented for local debugging -->
26     <!-- <deployenv>local</deployenv> -->
27     <nexusproxy>https://nexus.onap.org</nexusproxy>
28     <stagingNexusPath>content/repositories/staging/</stagingNexusPath>
29     <snapshotNexusPath>content/repositories/snapshots/</snapshotNexusPath>
30     <releaseNexusPath>content/repositories/releases/</releaseNexusPath>
31     <NPM_CMD>build</NPM_CMD>
32   </properties>
33
34
35   <repositories>
36     <repository>
37       <id>onap-staging</id>
38       <name>ONAP - Staging Repository</name>
39       <url>${nexusproxy}/${stagingNexusPath}</url>
40     </repository>
41     <repository>
42       <id>ecomp-releases</id>
43       <name>OpenECOMP - Release Repository</name>
44       <url>${nexusproxy}/${releaseNexusPath}</url>
45     </repository>
46     <repository>
47       <id>ecomp-snapshots</id>
48       <name>OpenECOMP - Snapshot Repository</name>
49       <url>${nexusproxy}/${snapshotNexusPath}</url>
50     </repository>
51     <repository>
52       <id>ecomp-public</id>
53       <name>ecomp onap public Repository</name>
54       <url>https://nexus.onap.org/content/groups/public</url>
55     </repository>
56   </repositories>
57
58   <distributionManagement>
59     <repository>
60       <id>ecomp-releases</id>
61       <name>VID Release Repository</name>
62       <url>${nexusproxy}/${releaseNexusPath}</url>
63     </repository>
64     <snapshotRepository>
65       <id>ecomp-snapshots</id>
66       <name>VID Snapshot Repository</name>
67       <url>${nexusproxy}/${snapshotNexusPath}</url>
68     </snapshotRepository>
69
70   </distributionManagement>
71
72   <profiles>
73     <profile>
74       <id>if-not-webpack</id>
75       <activation>
76         <property>
77           <name>skipModernUi</name>
78           <value>true</value>
79         </property>
80       </activation>
81       <build>
82         <plugins>
83           <plugin>
84             <groupId>org.apache.maven.plugins</groupId>
85             <artifactId>maven-antrun-plugin</artifactId>
86             <version>1.8</version>
87             <executions>
88               <execution>
89                 <id>make-empty-dist</id>
90                 <phase>validate</phase>
91                 <configuration>
92                   <target>
93                     <mkdir dir="${project.basedir}/dist/"/>
94                     <echo file="${project.basedir}/dist/NO-WEBPACK.txt" append="false">
95                       Note: 'webpack' profile was not selected while mvn build. This 'dist' folder was created to make
96                       the war creation through.
97                     </echo>
98                   </target>
99                 </configuration>
100                 <goals>
101                   <goal>run</goal>
102                 </goals>
103               </execution>
104             </executions>
105           </plugin>
106
107         </plugins>
108       </build>
109     </profile>
110     <profile>
111       <id>webpack-npm</id>
112       <activation>
113         <property>
114           <name>skipModernUi</name>
115           <value>!true</value>
116         </property>
117         <activeByDefault>true</activeByDefault>
118       </activation>
119       <build>
120         <plugins>
121           <plugin>
122             <groupId>com.github.eirslett</groupId>
123             <artifactId>frontend-maven-plugin</artifactId>
124             <!-- NB! Set <version> to the latest released version of frontend-maven-plugin, like in README.md -->
125             <version>1.6</version>
126
127             <executions>
128
129               <execution>
130                 <id>install node and npm</id>
131                 <goals>
132                   <goal>install-node-and-npm</goal>
133                 </goals>
134                 <configuration>
135                   <!-- See https://nodejs.org/en/download/ for latest node and npm (lts) versions -->
136                   <nodeVersion>v8.9.4</nodeVersion>
137                   <npmVersion>5.6.0</npmVersion>
138                 </configuration>
139               </execution>
140
141               <execution>
142                 <id>npm set no-progress</id>
143                 <goals>
144                   <goal>npm</goal>
145                 </goals>
146                 <configuration>
147                   <arguments>set progress=false</arguments>
148                 </configuration>
149               </execution>
150
151               <execution>
152                 <id>npm install</id>
153                 <goals>
154                   <goal>npm</goal>
155                 </goals>
156                 <!-- Optional configuration which provides for running any npm command -->
157                 <configuration>
158                   <arguments>install</arguments>
159                   <environmentVariables>
160                     <CYPRESS_INSTALL_BINARY>0</CYPRESS_INSTALL_BINARY>
161                   </environmentVariables>
162                 </configuration>
163               </execution>
164
165               <execution>
166                 <id>npm run</id>
167                 <goals>
168                   <goal>npm</goal>
169                 </goals>
170                 <configuration>
171                   <arguments>run ${NPM_CMD}</arguments>
172                 </configuration>
173               </execution>
174             </executions>
175           </plugin>
176         </plugins>
177       </build>
178     </profile>
179
180     <profile>
181       <id>cypress</id>
182       <build>
183         <plugins>
184           <plugin>
185             <groupId>com.github.eirslett</groupId>
186             <artifactId>frontend-maven-plugin</artifactId>
187             <!-- NB! Set <version> to the latest released version of frontend-maven-plugin, like in README.md -->
188             <version>1.6</version>
189
190             <executions>
191
192               <execution>
193                 <id>install node and npm</id>
194                 <goals>
195                   <goal>install-node-and-npm</goal>
196                 </goals>
197                 <configuration>
198                   <!-- See https://nodejs.org/en/download/ for latest node and npm (lts) versions -->
199                   <nodeVersion>v8.9.4</nodeVersion>
200                   <npmVersion>5.6.0</npmVersion>
201                 </configuration>
202               </execution>
203
204               <execution>
205                 <id>npm install cypress</id>
206                 <goals>
207                   <goal>npm</goal>
208                 </goals>
209                 <!-- Optional configuration which provides for running any npm command -->
210                 <configuration>
211                   <arguments>install --verbose cypress @bahmutov/add-typescript-to-cypress</arguments>
212                   <environmentVariables>
213                     <NO_PROXY>.att.com</NO_PROXY>
214                     <http_proxy>http://one.proxy.att.com:8080</http_proxy>
215                     <https_proxy>http://one.proxy.att.com:8080</https_proxy>
216                   </environmentVariables>
217                 </configuration>
218               </execution>
219
220               <execution>
221                 <id>npm run cypress</id>
222                 <goals>
223                   <goal>npm</goal>
224                 </goals>
225                 <configuration>
226                   <npmInheritsProxyConfigFromMaven>false</npmInheritsProxyConfigFromMaven>
227                   <arguments>run cypress:run -- --config baseUrl=http://${VID_HOST}:8080/vid</arguments>
228                 </configuration>
229               </execution>
230
231             </executions>
232           </plugin>
233         </plugins>
234       </build>
235     </profile>
236   </profiles>
237
238   <build>
239     <finalName>vid-webpack-master</finalName>
240     <plugins>
241
242       <plugin>
243         <groupId>org.apache.maven.plugins</groupId>
244         <artifactId>maven-war-plugin</artifactId>
245         <version>3.2.0</version>
246         <configuration>
247           <webResources>
248             <resource>
249               <!-- this is relative to the pom.xml directory -->
250               <directory>dist</directory>
251               <targetPath>app/ui</targetPath>
252             </resource>
253           </webResources>
254           <webXml>src/WEB-INF/web.xml</webXml>
255         </configuration>
256       </plugin>
257     <plugin>
258       <artifactId>maven-clean-plugin</artifactId>
259       <configuration>
260         <filesets>
261           <fileset>
262             <directory>dist</directory>
263           </fileset>
264         </filesets>
265       </configuration>
266     </plugin>
267     </plugins>
268   </build>
269   <dependencies>
270   </dependencies>
271 </project>