Fix package of apex examples and documents
[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.0.0-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.onap.policy.apex-pdp.client</groupId>
41             <artifactId>client-common</artifactId>
42             <version>${project.version}</version>
43             <classifier>resources</classifier>
44             <type>zip</type>
45             <scope>provided</scope>
46         </dependency>
47         <dependency>
48             <groupId>org.glassfish.jersey.containers</groupId>
49             <artifactId>jersey-container-grizzly2-http</artifactId>
50             <version>${version.jersey}</version>
51         </dependency>
52         <dependency>
53             <groupId>org.glassfish.jersey.containers</groupId>
54             <artifactId>jersey-container-servlet-core</artifactId>
55             <version>${version.jersey}</version>
56         </dependency>
57         <dependency>
58             <groupId>org.glassfish.jersey.inject</groupId>
59             <artifactId>jersey-hk2</artifactId>
60             <version>${version.jersey}</version>
61         </dependency>
62         <dependency>
63             <groupId>commons-cli</groupId>
64             <artifactId>commons-cli</artifactId>
65         </dependency>
66     </dependencies>
67
68     <build>
69         <defaultGoal>install</defaultGoal>
70         <outputDirectory>${project.build.directory}/classes</outputDirectory>
71         <plugins>
72             <plugin>
73                 <groupId>org.apache.maven.plugins</groupId>
74                 <artifactId>maven-dependency-plugin</artifactId>
75                 <executions>
76                     <execution>
77                         <id>unpack-client-monitoring-shared-resources</id>
78                         <goals>
79                             <goal>unpack-dependencies</goal>
80                         </goals>
81                         <phase>validate</phase>
82                         <configuration>
83                             <outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}</outputDirectory>
84                             <includeArtifacIds>client-common</includeArtifacIds>
85                             <includeGroupIds>${project.groupId}</includeGroupIds>
86                             <excludeTransitive>true</excludeTransitive>
87                         </configuration>
88                     </execution>
89                 </executions>
90             </plugin>
91             <plugin>
92                 <groupId>org.apache.maven.plugins</groupId>
93                 <artifactId>maven-resources-plugin</artifactId>
94                 <version>3.1.0</version>
95                 <executions>
96                     <execution>
97                         <id>copy-common-resources-to-jar</id>
98                         <phase>initialize</phase>
99                         <goals>
100                             <goal>copy-resources</goal>
101                         </goals>
102                         <configuration>
103                             <outputDirectory>${project.build.directory}/classes/webapp</outputDirectory>
104                             <filtering>false</filtering>
105                             <resources>
106                                 <resource>
107                                     <directory>../client-common/src/main/resources</directory>
108                                 </resource>
109                             </resources>
110                             <overwrite>true</overwrite>
111                         </configuration>
112                     </execution>
113                     <execution>
114                         <id>copy-local-resources-to-jar</id>
115                         <phase>generate-sources</phase>
116                         <goals>
117                             <goal>copy-resources</goal>
118                         </goals>
119                         <configuration>
120                             <outputDirectory>${project.build.directory}/classes/webapp</outputDirectory>
121                             <filtering>false</filtering>
122                             <resources>
123                                 <resource>
124                                     <directory>src/main/resources/webapp</directory>
125                                 </resource>
126                             </resources>
127                             <overwrite>true</overwrite>
128                         </configuration>
129                     </execution>
130                 </executions>
131             </plugin>
132             <plugin>
133                 <groupId>org.apache.maven.plugins</groupId>
134                 <artifactId>maven-shade-plugin</artifactId>
135                 <version>2.4.3</version>
136                 <executions>
137                     <execution>
138                         <phase>package</phase>
139                         <goals>
140                             <goal>shade</goal>
141                         </goals>
142                     </execution>
143                 </executions>
144                 <configuration>
145                     <finalName>${project.artifactId}-uber-${project.version}</finalName>
146                     <shadedArtifactAttached>true</shadedArtifactAttached>
147                     <shadedClassifierName>monitoring</shadedClassifierName>
148                     <artifactSet>
149                         <includes>
150                             <include>*:*</include>
151                         </includes>
152                     </artifactSet>
153                     <filters>
154                         <filter>
155                             <artifact>*:*</artifact>
156                             <excludes>
157                                 <exclude>META-INF/*.SF</exclude>
158                                 <exclude>META-INF/*.DSA</exclude>
159                                 <exclude>META-INF/*.RSA</exclude>
160                             </excludes>
161                         </filter>
162                     </filters>
163                     <transformers>
164                         <transformer
165                             implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
166                         <transformer
167                             implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
168                             <resource>reference.conf</resource>
169                         </transformer>
170                         <transformer
171                             implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
172                             <resource>log4j.properties</resource>
173                         </transformer>
174                         <transformer
175                             implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
176                             <mainClass>org.onap.policy.apex.client.monitoring.rest.ApexMonitoringRestMain</mainClass>
177                         </transformer>
178                     </transformers>
179                 </configuration>
180             </plugin>
181             <plugin>
182                 <groupId>org.apache.maven.plugins</groupId>
183                 <artifactId>maven-war-plugin</artifactId>
184                 <version>2.6</version>
185                 <configuration>
186                     <classifier>ui</classifier>
187                     <warSourceDirectory>src/main/resources/webapp</warSourceDirectory>
188                     <webXml>src/main/resources/webapp/WEB-INF/web.xml</webXml>
189                 </configuration>
190                 <executions>
191                     <execution>
192                         <phase>prepare-package</phase>
193                         <goals>
194                             <goal>war</goal>
195                         </goals>
196                     </execution>
197                 </executions>
198             </plugin>
199             <plugin>
200                 <groupId>org.codehaus.mojo</groupId>
201                 <artifactId>build-helper-maven-plugin</artifactId>
202                 <version>3.0.0</version>
203                 <executions>
204                     <execution>
205                         <id>attach-artifacts</id>
206                         <phase>package</phase>
207                         <goals>
208                             <goal>attach-artifact</goal>
209                         </goals>
210                         <configuration>
211                             <artifacts>
212                                 <artifact>
213                                     <file>${project.build.directory}/${project.artifactId}-${project.version}-ui.war</file>
214                                     <type>war</type>
215                                 </artifact>
216                                 <artifact>
217                                     <file>${project.build.directory}/${project.artifactId}-uber-${project.version}.jar</file>
218                                     <type>uber.jar</type>
219                                 </artifact>
220                             </artifacts>
221                         </configuration>
222                     </execution>
223                 </executions>
224             </plugin>
225         </plugins>
226     </build>
227
228     <profiles>
229         <profile>
230             <id>apexSite</id>
231             <activation>
232                 <property>
233                     <name>apexSite</name>
234                 </property>
235             </activation>
236             <distributionManagement>
237                 <site>
238                     <id>${project.artifactId}-site</id>
239                     <url>${apex.adsite.prefix}/modules/${project.parent.artifactId}/${project.artifactId}/</url>
240                 </site>
241             </distributionManagement>
242         </profile>
243     </profiles>
244 </project>