Merge "Revert "[sdc] - ecomp portal version fix""
[sdc.git] / catalog-ui / pom.xml
1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
4         <modelVersion>4.0.0</modelVersion>
5
6         <groupId>org.openecomp.sdc</groupId>
7         <artifactId>catalog-ui</artifactId>
8     <packaging>pom</packaging>
9
10
11         <parent>
12                 <groupId>org.openecomp.sdc</groupId>
13                 <artifactId>sdc-main</artifactId>
14                 <version>1.1.0-SNAPSHOT</version>
15         </parent>
16
17
18
19         <build>
20                 <plugins>
21
22                         <!--  ============================================= -->
23                         <!--  Clean webapps folder                          -->
24                         <!--  ============================================= -->
25                         <plugin>
26                                 <artifactId>maven-clean-plugin</artifactId>
27                                 <version>2.6.1</version>
28                 <executions>
29                     <execution>
30                         <id>clean.fe.webapp.folder</id>
31                         <phase>initialize</phase>
32                         <goals>
33                             <goal>clean</goal>
34                         </goals>
35                         <configuration>
36
37                             <filesets>
38                                 <fileset>
39                                     <directory>${project.parent.basedir}/catalog-fe/src/main/webapp</directory>
40                                     <includes>
41                                         <include>**/*</include>
42                                         <include>*</include>
43                                     </includes>
44                                     <excludes>
45                                         <exclude>META-INF/*</exclude>
46                                         <exclude>WEB-INF/*</exclude>
47                                     </excludes>
48                                     <followSymlinks>false</followSymlinks>
49                                 </fileset>
50                             </filesets>
51                         </configuration>
52                     </execution>
53                     <!-- <execution>
54                         <id>clean.dist.folder</id>
55                         <phase>clean</phase>
56                         <goals>
57                             <goal>clean</goal>
58                         </goals>
59                         <configuration>
60                             <filesets>
61                                 <fileset>
62                                     <directory>${basedir}/node_modules</directory>
63                                 </fileset>
64                                 <fileset>
65                                     <directory>${basedir}/dist</directory>
66                                 </fileset>
67                             </filesets>
68                         </configuration>
69                     </execution> -->
70                 </executions>
71                         </plugin>
72
73
74                         <plugin>
75                                 <artifactId>maven-resources-plugin</artifactId>
76                                 <version>2.7</version>
77                                 <executions>
78                                         <execution>
79                                                 <id>copy-resources</id>
80                                                 <phase>package</phase>
81                                                 <goals>
82                                                         <goal>copy-resources</goal>
83                                                 </goals>
84                                                 <configuration>
85                                                         <outputDirectory>${project.parent.basedir}/catalog-fe/src/main/webapp</outputDirectory>
86                                                         <resources>
87                                                                 <resource>
88                                                                         <directory>${project.basedir}/dist</directory>
89                                                                         <filtering>false</filtering>
90                                                                 </resource>
91                                                         </resources>
92                                                 </configuration>
93                                         </execution>
94                                 </executions>
95                         </plugin>
96             <plugin>
97                 <groupId>com.github.eirslett</groupId>
98                 <artifactId>frontend-maven-plugin</artifactId>
99                 <version>1.4</version>
100
101                 <configuration>
102                                 <installDirectory>${project.parent.basedir}</installDirectory>
103                                 </configuration>
104
105                 <executions>
106                     <execution>
107                         <id>install node and npm</id>
108                         <goals>
109                             <goal>install-node-and-npm</goal>
110                         </goals>
111                         <configuration>
112                             <!-- See https://nodejs.org/en/download/ for latest node and npm (lts) versions -->
113                             <nodeVersion>v6.9.5</nodeVersion>
114                             <npmVersion>3.10.10</npmVersion>
115                         </configuration>
116                     </execution>
117
118                     <execution>
119                         <id>npm set progress off</id>
120                         <goals>
121                                 <goal>npm</goal>
122                         </goals>
123                         <configuration>
124                                 <arguments>set progress=false</arguments>
125                         </configuration>
126                     </execution>
127
128                     <execution>
129                         <id>npm install</id>
130                         <goals>
131                             <goal>npm</goal>
132                         </goals>
133                         <!-- Optional configuration which provides for running any npm command -->
134                         <configuration>
135                             <arguments>install</arguments>
136                         </configuration>
137                     </execution>
138
139                     <execution>
140                         <id>npm run build</id>
141                         <goals>
142                             <goal>npm</goal>
143                         </goals>
144                         <configuration>
145                             <arguments>run build:prod</arguments>
146                         </configuration>
147                     </execution>
148                 </executions>
149             </plugin>
150
151                 </plugins>
152         </build>
153
154
155
156         <profiles>
157                 <profile>
158                         <id>CI</id>
159                         <activation>
160                                 <activeByDefault>false</activeByDefault>
161                         </activation>
162
163                         <build>
164                                 <plugins>
165                                         <plugin>
166                                                 <artifactId>maven-resources-plugin</artifactId>
167                                                 <version>2.7</version>
168                                                 <executions>
169                                                         <execution>
170                                                                 <id>copy-resources</id>
171                                                                 <phase>package</phase>
172                                                                 <goals>
173                                                                         <goal>copy-resources</goal>
174                                                                 </goals>
175
176                                                                 <configuration>
177                                                                         <outputDirectory>${project.parent.basedir}/catalog-fe/src/main/webapp</outputDirectory>
178                                                                         <resources>
179                                                                                 <resource>
180                                                                                         <directory>${project.basedir}/dist</directory>
181                                                                                         <filtering>false</filtering>
182                                                                                 </resource>
183                                                                         </resources>
184                                                                 </configuration>
185                                                         </execution>
186                                                 </executions>
187                                         </plugin>
188
189
190
191                                         <!--  ============================================= -->
192                                         <!--  Build the UI module node code                 -->
193                                         <!--  ============================================= -->
194                                         <plugin>
195                                                 <groupId>org.codehaus.mojo</groupId>
196                                                 <artifactId>exec-maven-plugin</artifactId>
197                                                 <version>1.4.0</version>
198                                                 <executions>
199
200                                                         <!-- Set execution permissions for the build script -->
201                                                         <execution>
202                                                                 <id>set.script.permissions</id>
203                                                                 <phase>generate-sources</phase>
204                                                                 <goals>
205                                                                         <goal>exec</goal>
206                                                                 </goals>
207
208                                                                 <configuration>
209                                                                         <workingDirectory>${project.basedir}</workingDirectory>
210                                                                         <executable>/bin/chmod</executable>
211                                                                         <arguments>
212                                                                                 <argument>755</argument>
213                                                                                 <argument>./build_catalog_ui.sh</argument>
214                                                                         </arguments>
215                                                                 </configuration>
216                                                         </execution>
217
218                                                         <!-- Run the build script -->
219                                                         <execution>
220                                                                 <id>execute grant build</id>
221                                                                 <phase>generate-sources</phase>
222                                                                 <goals>
223                                                                         <goal>exec</goal>
224                                                                 </goals>
225
226                                                                 <configuration>
227                                                                         <workingDirectory>${project.basedir}</workingDirectory>
228                                                                         <executable>./build_catalog_ui.sh</executable>
229                                                                 </configuration>
230                                                         </execution>
231
232                                                         <!-- Undo checkout the build script -->
233                                                         <execution>
234                                                                 <id>undo.checkout.script</id>
235                                                                 <phase>generate-sources</phase>
236                                                                 <goals>
237                                                                         <goal>exec</goal>
238                                                                 </goals>
239
240                                                                 <configuration>
241                                                                         <workingDirectory>${project.basedir}</workingDirectory>
242                                                                         <executable>/usr/bin/git</executable>
243                                                                         <arguments>
244                                                                                 <argument>checkout</argument>
245                                                                                 <argument>--</argument>
246                                                                                 <argument>./build_catalog_ui.sh</argument>
247                                                                         </arguments>
248                                                                 </configuration>
249                                                         </execution>
250                                                 </executions>
251                                         </plugin>
252                                 </plugins>
253                         </build>
254                 </profile>
255
256
257                 <profile>
258                         <id>Fortify</id>
259                         <activation>
260                                 <activeByDefault>false</activeByDefault>
261                         </activation>
262
263                         <build>
264                                 <plugins>
265                                         <plugin>
266                                                 <groupId>com.fortify.ps.maven.plugin</groupId>
267                                                 <artifactId>sca-maven-plugin</artifactId>
268                                                 <version>4.30</version>
269                                                 <configuration>
270                                                         <source>1.8</source>
271                                                         <buildId>${project.parent.artifactId}</buildId>
272                                                         <toplevelArtifactId>${project.parent.artifactId}</toplevelArtifactId>
273                                                 </configuration>
274                                         </plugin>
275                                 </plugins>
276                         </build>
277                 </profile>
278
279         <profile>
280             <id>not-minified</id>
281             <activation>
282                 <activeByDefault>false</activeByDefault>
283             </activation>
284
285             <build>
286                 <plugins>
287                     <plugin>
288                         <artifactId>maven-resources-plugin</artifactId>
289                         <version>2.7</version>
290                         <executions>
291                             <execution>
292                                 <id>copy-resources</id>
293                                 <phase>package</phase>
294                                 <goals>
295                                     <goal>copy-resources</goal>
296                                 </goals>
297                                 <configuration>
298                                     <outputDirectory>${project.parent.basedir}/catalog-fe/src/main/webapp</outputDirectory>
299                                     <resources>
300                                         <resource>
301                                             <directory>${project.basedir}/app</directory>
302                                             <includes>
303                                                 <include>languages/**</include>
304                                                 <include>scripts/**</include>
305                                                 <include>styles/**</include>
306                                                 <include>third-party/**</include>
307                                                 <include>index.html</include>
308                                                 <include>robots.txt</include>
309                                                 <include>favicon.png</include>
310                                             </includes>
311                                             <filtering>false</filtering>
312                                         </resource>
313                                         <resource>
314                                             <directory>${project.basedir}</directory>
315                                             <includes>
316                                                 <include>bower_components/**</include>
317                                             </includes>
318                                             <filtering>false</filtering>
319                                         </resource>
320                                     </resources>
321                                 </configuration>
322                             </execution>
323                         </executions>
324                     </plugin>
325                 </plugins>
326             </build>
327         </profile>
328         </profiles>
329 </project>
330