Updating module names to resolve conflicts
[policy/apex-pdp.git] / client / client-monitoring / pom.xml
1 <!--
2   ============LICENSE_START=======================================================
3    Copyright (C) 2018 Ericsson. All rights reserved.
4    Modifications Copyright (C) 2019 Nordix Foundation.
5    Modifications Copyright (C) 2020 Bell Canada.
6   ================================================================================
7   Licensed under the Apache License, Version 2.0 (the "License");
8   you may not use this file except in compliance with the License.
9   You may obtain a copy of the License at
10
11        http://www.apache.org/licenses/LICENSE-2.0
12
13   Unless required by applicable law or agreed to in writing, software
14   distributed under the License is distributed on an "AS IS" BASIS,
15   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   See the License for the specific language governing permissions and
17   limitations under the License.
18
19   SPDX-License-Identifier: Apache-2.0
20   ============LICENSE_END=========================================================
21 -->
22 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24     <modelVersion>4.0.0</modelVersion>
25     <parent>
26         <groupId>org.onap.policy.apex-pdp.client</groupId>
27         <artifactId>apex-client</artifactId>
28         <version>2.3.0-SNAPSHOT</version>
29     </parent>
30
31     <artifactId>apex-client-monitoring</artifactId>
32     <name>${project.artifactId}</name>
33     <description>Web client for monitoring Apex engines</description>
34
35     <dependencies>
36          <dependency>
37             <groupId>org.onap.policy.common</groupId>
38             <artifactId>policy-endpoints</artifactId>
39         </dependency>
40         <dependency>
41             <groupId>org.onap.policy.apex-pdp.core</groupId>
42             <artifactId>core-deployment</artifactId>
43             <version>${project.version}</version>
44         </dependency>
45         <dependency>
46             <groupId>org.glassfish.jersey.containers</groupId>
47             <artifactId>jersey-container-grizzly2-http</artifactId>
48         </dependency>
49         <dependency>
50             <groupId>commons-cli</groupId>
51             <artifactId>commons-cli</artifactId>
52         </dependency>
53         <dependency>
54             <groupId>org.mockito</groupId>
55             <artifactId>mockito-all</artifactId>
56             <scope>test</scope>
57         </dependency>
58
59         <dependency>
60             <groupId>org.onap.policy.apex-pdp.client</groupId>
61             <artifactId>apex-client-common</artifactId>
62             <version>${project.version}</version>
63             <classifier>resources</classifier>
64             <type>zip</type>
65             <scope>provided</scope>
66         </dependency>
67
68     </dependencies>
69
70     <build>
71         <defaultGoal>install</defaultGoal>
72         <outputDirectory>${project.build.directory}/classes</outputDirectory>
73         <plugins>
74
75 <!-- https://blog.sonatype.com/2008/04/how-to-share-resources-across-projects-in-maven/ -->
76             <plugin>
77                 <groupId>org.apache.maven.plugins</groupId>
78                 <artifactId>maven-dependency-plugin</artifactId>
79                 <executions>
80                     <execution>
81                         <id>unpack-shared-resources</id>
82                         <goals>
83                             <goal>unpack-dependencies</goal>
84                         </goals>
85                         <phase>generate-resources</phase>
86                         <configuration>
87                             <outputDirectory>${project.build.directory}/classes/webapp</outputDirectory>
88        <!--use as much as needed to be specific...also scope,type,classifier etc-->
89                             <includeArtifacIds>apex-client-common</includeArtifacIds>
90                             <includeGroupIds>org.onap.policy.apex-pdp.client</includeGroupIds>
91                             <excludeTransitive>true</excludeTransitive>
92                             <excludeTypes>jar</excludeTypes>
93                             <includeTypes>zip</includeTypes>
94                             <excludeTransitive>true</excludeTransitive>
95                         </configuration>
96                     </execution>
97                 </executions>
98             </plugin>
99             <plugin>
100                 <groupId>org.apache.maven.plugins</groupId>
101                 <artifactId>maven-assembly-plugin</artifactId>
102                 <executions>
103                     <execution>
104                         <id>make shared resources</id>
105                         <goals>
106                             <goal>single</goal>
107                         </goals>
108                         <phase>package</phase>
109                         <configuration>
110                             <descriptors>
111                                 <descriptor>src/main/assembly/resources.xml</descriptor>
112                             </descriptors>
113                         </configuration>
114                     </execution>
115                 </executions>
116             </plugin>
117
118
119             <plugin>
120                 <groupId>org.apache.maven.plugins</groupId>
121                 <artifactId>maven-shade-plugin</artifactId>
122                 <executions>
123                     <execution>
124                         <phase>package</phase>
125                         <goals>
126                             <goal>shade</goal>
127                         </goals>
128                     </execution>
129                 </executions>
130                 <configuration>
131                     <finalName>${project.artifactId}-uber-${project.version}</finalName>
132                     <shadedArtifactAttached>true</shadedArtifactAttached>
133                     <shadedClassifierName>monitoring</shadedClassifierName>
134                     <artifactSet>
135                         <includes>
136                             <include>*:*</include>
137                         </includes>
138                     </artifactSet>
139                     <filters>
140                         <filter>
141                             <artifact>*:*</artifact>
142                             <excludes>
143                                 <exclude>META-INF/*.SF</exclude>
144                                 <exclude>META-INF/*.DSA</exclude>
145                                 <exclude>META-INF/*.RSA</exclude>
146                             </excludes>
147                         </filter>
148                     </filters>
149                     <transformers>
150                         <transformer
151                             implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
152                         <transformer
153                             implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
154                             <resource>reference.conf</resource>
155                         </transformer>
156                         <transformer
157                             implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
158                             <resource>log4j.properties</resource>
159                         </transformer>
160                         <transformer
161                             implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
162                             <mainClass>org.onap.policy.apex.client.monitoring.rest.ApexMonitoringRestMain</mainClass>
163                         </transformer>
164                     </transformers>
165                 </configuration>
166             </plugin>
167             <plugin>
168                 <groupId>org.apache.maven.plugins</groupId>
169                 <artifactId>maven-war-plugin</artifactId>
170                 <configuration>
171                     <classifier>ui</classifier>
172                     <warSourceDirectory>src/main/resources/webapp</warSourceDirectory>
173                     <webXml>src/main/resources/webapp/WEB-INF/web.xml</webXml>
174                 </configuration>
175                 <executions>
176                     <execution>
177                         <phase>prepare-package</phase>
178                         <goals>
179                             <goal>war</goal>
180                         </goals>
181                     </execution>
182                 </executions>
183             </plugin>
184             <plugin>
185                 <groupId>org.codehaus.mojo</groupId>
186                 <artifactId>build-helper-maven-plugin</artifactId>
187                 <version>3.0.0</version>
188                 <executions>
189                     <execution>
190                         <id>attach-artifacts</id>
191                         <phase>package</phase>
192                         <goals>
193                             <goal>attach-artifact</goal>
194                         </goals>
195                         <configuration>
196                             <artifacts>
197                                 <artifact>
198                                     <file>${project.build.directory}/${project.artifactId}-${project.version}-ui.war</file>
199                                     <type>war</type>
200                                 </artifact>
201                                 <artifact>
202                                     <file>${project.build.directory}/${project.artifactId}-uber-${project.version}.jar</file>
203                                     <type>uber.jar</type>
204                                 </artifact>
205                             </artifacts>
206                         </configuration>
207                     </execution>
208                 </executions>
209             </plugin>
210         </plugins>
211     </build>
212
213     <profiles>
214         <profile>
215             <id>apexSite</id>
216             <activation>
217                 <property>
218                     <name>apexSite</name>
219                 </property>
220             </activation>
221             <distributionManagement>
222                 <site>
223                     <id>${project.artifactId}-site</id>
224                     <url>${apex.adsite.prefix}/modules/${project.parent.artifactId}/${project.artifactId}/</url>
225                 </site>
226             </distributionManagement>
227         </profile>
228     </profiles>
229 </project>