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