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