blob: 0289f44c53caef5e39d4d4617f68031dc247182f [file] [log] [blame]
brunomilitzerd5fd1172021-05-10 16:51:15 +01001<!--
2 ============LICENSE_START=======================================================
liamfallonea764f92022-09-26 15:46:55 +01003 Copyright (C) 2021-2022 Nordix Foundation.
brunomilitzerd5fd1172021-05-10 16:51:15 +01004 ================================================================================
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16
17 SPDX-License-Identifier: Apache-2.0
18 ============LICENSE_END=========================================================
brunomilitzer87111ee2021-05-18 12:50:32 +010019 -->
brunomilitzerd5fd1172021-05-10 16:51:15 +010020<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
brunomilitzer87111ee2021-05-18 12:50:32 +010021 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
brunomilitzerd5fd1172021-05-10 16:51:15 +010022 <modelVersion>4.0.0</modelVersion>
23 <parent>
24 <groupId>org.onap.policy.gui</groupId>
25 <artifactId>policy-gui</artifactId>
liamfallon3a6d8b42022-10-21 15:23:33 +010026 <version>2.3.2-SNAPSHOT</version>
brunomilitzerd5fd1172021-05-10 16:51:15 +010027 </parent>
brunomilitzerd5fd1172021-05-10 16:51:15 +010028 <artifactId>gui-clamp</artifactId>
29 <packaging>pom</packaging>
30 <name>${project.artifactId}</name>
31 <description>This module contains the implementation code for the CLAMP GUIs in the Policy Framework</description>
brunomilitzer87111ee2021-05-18 12:50:32 +010032 <properties>
33 <ui.react.src>ui-react</ui.react.src>
34 <ui.react.lib.src>ui-react-lib</ui.react.lib.src>
arkadiusz.adamski392e5e22021-06-28 17:45:45 +010035 <npm.publish.url>https://nexus3.onap.org/repository/npm.snapshot/</npm.publish.url>
saul.gill3ce37242021-11-01 15:12:48 +000036 <sonar.nodejs.executable>${project.build.directory}/ui-react/node/node</sonar.nodejs.executable>
37 <sonar.sources>${project.basedir}/ui-react/src</sonar.sources>
lapentafd553f1e72022-03-16 10:44:25 +000038 <sonar.exclusions>**/*.test.js, **/*/*Loop*.js, **/loop_viewer/**/*</sonar.exclusions>
brunomilitzer87111ee2021-05-18 12:50:32 +010039 </properties>
40 <build>
41 <plugins>
42 <plugin>
43 <artifactId>maven-resources-plugin</artifactId>
brunomilitzer87111ee2021-05-18 12:50:32 +010044 <executions>
45 <execution>
46 <id>copy-resources-1</id>
47 <!-- here the phase you need -->
48 <phase>compile</phase>
49 <goals>
50 <goal>copy-resources</goal>
51 </goals>
52 <configuration>
53 <outputDirectory>${project.build.directory}/${ui.react.src}</outputDirectory>
54 <resources>
55 <resource>
56 <directory>${ui.react.src}</directory>
57 <excludes>
58 <exclude>node_modules</exclude>
59 </excludes>
60 <includes>
61 <include>src/**</include>
62 <include>public/**</include>
63 <include>package.json</include>
64 <include>package-lock.json</include>
65 </includes>
66 <filtering>true</filtering>
67 </resource>
68 </resources>
69 </configuration>
70 </execution>
71 <execution>
72 <id>copy-resources-2</id>
73 <!-- here the phase you need -->
74 <phase>compile</phase>
75 <goals>
76 <goal>copy-resources</goal>
77 </goals>
78 <configuration>
79 <outputDirectory>${project.build.directory}/${ui.react.src}</outputDirectory>
80 <resources>
81 <resource>
82 <directory>${ui.react.src}</directory>
83 <includes>
84 <include>src/**</include>
85 </includes>
86 <excludes>
87 <exclude>**/__snapshots__/**</exclude>
88 <exclude>**/**.test.js</exclude>
89 </excludes>
90 <filtering>true</filtering>
91 </resource>
92 </resources>
93 </configuration>
94 </execution>
95 <execution>
96 <id>copy-resources-3</id>
97 <!-- here the phase you need -->
98 <phase>compile</phase>
99 <goals>
100 <goal>copy-resources</goal>
101 </goals>
102 <configuration>
103 <outputDirectory>${project.build.directory}/${ui.react.lib.src}</outputDirectory>
104 <resources>
105 <resource>
106 <directory>${ui.react.lib.src}</directory>
107 <includes>
108 <include>**</include>
109 </includes>
110 <excludes>
111 <exclude>node_modules/**</exclude>
112 <exclude>package-lock.json</exclude>
113 </excludes>
114 <filtering>true</filtering>
115 </resource>
116 </resources>
117 </configuration>
118 </execution>
119 </executions>
120 </plugin>
121 <plugin>
122 <groupId>com.github.eirslett</groupId>
123 <artifactId>frontend-maven-plugin</artifactId>
124 <version>1.11.3</version>
125 <configuration>
126 <installDirectory>${project.build.directory}/${ui.react.src}</installDirectory>
127 <npmDownloadRoot>${repo.npm}</npmDownloadRoot>
128 </configuration>
129 <executions>
130 <execution>
131 <id>install node and npm</id>
132 <goals>
133 <goal>install-node-and-npm</goal>
134 </goals>
135 <phase>generate-sources</phase>
136 <configuration>
137 <nodeVersion>v14.17.0</nodeVersion>
138 </configuration>
139 </execution>
140 <execution>
141 <id>npm_install</id>
142 <goals>
143 <goal>npm</goal>
144 </goals>
145 <phase>compile</phase>
146 <configuration>
147 <workingDirectory>${project.build.directory}/${ui.react.src}</workingDirectory>
148 <arguments>install</arguments>
149 </configuration>
150 </execution>
151 <execution>
danielhanrahan608e6252021-08-20 16:55:19 +0100152 <id>npm_build</id>
153 <goals>
154 <goal>npm</goal>
155 </goals>
156 <phase>package</phase>
157 <configuration>
158 <workingDirectory>${project.build.directory}/${ui.react.src}</workingDirectory>
159 <arguments>run build</arguments>
160 </configuration>
161 </execution>
162 <execution>
brunomilitzer87111ee2021-05-18 12:50:32 +0100163 <id>npm_test</id>
164 <goals>
165 <goal>npm</goal>
166 </goals>
167 <phase>test</phase>
168 <configuration>
169 <skip>${maven.test.skip}</skip>
170 <arguments>run-script test:coverage</arguments>
171 <workingDirectory>${project.build.directory}/${ui.react.src}</workingDirectory>
172 </configuration>
173 </execution>
danielhanrahan608e6252021-08-20 16:55:19 +0100174 <!-- XXX Are these deploy steps using npm desirable given docker image generation? -->
brunomilitzer87111ee2021-05-18 12:50:32 +0100175 <execution>
176 <id>npm_install_lib</id>
177 <goals>
178 <goal>npm</goal>
179 </goals>
180 <phase>deploy</phase>
181 <configuration>
182 <workingDirectory>${project.build.directory}/${ui.react.lib.src}</workingDirectory>
183 <arguments>install</arguments>
184 </configuration>
185 </execution>
186 <execution>
187 <id>npm_build_lib</id>
188 <goals>
189 <goal>npm</goal>
190 </goals>
191 <phase>deploy</phase>
192 <configuration>
193 <workingDirectory>${project.build.directory}/${ui.react.lib.src}</workingDirectory>
194 <arguments>run build</arguments>
195 </configuration>
196 </execution>
197 <execution>
198 <id>npm_publish</id>
199 <goals>
200 <goal>npm</goal>
201 </goals>
202 <phase>deploy</phase>
203 <configuration>
204 <workingDirectory>${project.build.directory}/${ui.react.lib.src}</workingDirectory>
205 <arguments>publish</arguments>
206 </configuration>
207 </execution>
208 </executions>
209 </plugin>
210 <plugin>
211 <groupId>org.apache.maven.plugins</groupId>
212 <artifactId>maven-clean-plugin</artifactId>
213 <version>3.0.0</version>
214 <configuration>
215 <filesets>
216 <fileset>
217 <directory>${ui.react.lib.src}/node</directory>
218 </fileset>
219 <fileset>
220 <directory>${ui.react.src}/node</directory>
221 </fileset>
222 <fileset>
223 <directory>${ui.react.src}/node_modules</directory>
224 </fileset>
225 <fileset>
226 <directory>${ui.react.lib.src}/node_modules</directory>
227 </fileset>
228 </filesets>
229 </configuration>
230 </plugin>
231 <plugin>
232 <groupId>org.apache.maven.plugins</groupId>
233 <artifactId>maven-compiler-plugin</artifactId>
brunomilitzer87111ee2021-05-18 12:50:32 +0100234 <configuration>
235 <source>11</source>
236 <target>11</target>
237 </configuration>
238 </plugin>
239 <plugin>
240 <groupId>org.codehaus.mojo</groupId>
241 <artifactId>versions-maven-plugin</artifactId>
brunomilitzer87111ee2021-05-18 12:50:32 +0100242 </plugin>
danielhanrahan608e6252021-08-20 16:55:19 +0100243 <plugin>
244 <groupId>org.apache.maven.plugins</groupId>
245 <artifactId>maven-assembly-plugin</artifactId>
246 <executions>
247 <execution>
248 <id>generate-gui-clamp-tar</id>
249 <phase>package</phase>
250 <goals>
251 <goal>single</goal>
252 </goals>
253 <configuration>
254 <descriptors>
255 <descriptor>src/main/assembly/clamp-build.xml</descriptor>
256 </descriptors>
257 <finalName>${project.artifactId}-${project.version}</finalName>
258 </configuration>
259 </execution>
260 </executions>
261 </plugin>
brunomilitzer87111ee2021-05-18 12:50:32 +0100262 </plugins>
263 </build>
brunomilitzerd5fd1172021-05-10 16:51:15 +0100264</project>