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