Move docker plugins into profile
[aai/model-loader.git] / pom.xml
1 <!--
2      ============LICENSE_START=======================================================
3      MODEL LOADER SERVICE
4      ================================================================================
5      Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
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      ============LICENSE_END=========================================================
19    -->
20
21 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
23         <modelVersion>4.0.0</modelVersion>
24         <groupId>org.openecomp.aai.model-loader</groupId>
25         <artifactId>model-loader</artifactId>
26         <version>1.0.0-SNAPSHOT</version>
27         <packaging>war</packaging>
28         
29         <properties>
30                 <docker.location>${basedir}/target</docker.location>
31                 <dependency.scope>provided</dependency.scope>
32                 <checkstyle.config.location>google_checks.xml</checkstyle.config.location>
33                 <maven.compiler.source>1.8</maven.compiler.source>
34         <maven.compiler.target>1.8</maven.compiler.target>
35         </properties>
36
37         <dependencies>
38                 <dependency>
39                         <groupId>org.mockito</groupId>
40                         <artifactId>mockito-all</artifactId>
41                         <version>1.10.19</version>
42                         <scope>test</scope>
43                 </dependency>
44                 <dependency>
45                         <groupId>org.powermock</groupId>
46                         <artifactId>powermock-module-junit4</artifactId>
47                         <version>1.6.2</version>
48                         <scope>test</scope>
49                 </dependency>
50                 <dependency>
51                         <groupId>org.powermock</groupId>
52                         <artifactId>powermock-api-mockito</artifactId>
53                         <version>1.6.2</version>
54                         <scope>test</scope>
55                 </dependency>
56                 <dependency>
57                         <groupId>org.powermock</groupId>
58                         <artifactId>powermock-module-javaagent</artifactId>
59                         <version>1.6.2</version>
60                         <scope>test</scope>
61                 </dependency>
62                 <dependency>
63                         <groupId>org.powermock</groupId>
64                         <artifactId>powermock-module-junit4-rule-agent</artifactId>
65                         <version>1.6.2</version>
66                         <scope>test</scope>
67                 </dependency>
68                 <!-- xjc dependencies -->
69                 <dependency>
70                         <groupId>javax.xml.bind</groupId>
71                         <artifactId>jaxb-api</artifactId>
72                         <version>2.2.11</version>
73                 </dependency>
74                 <dependency>
75                         <groupId>com.sun.xml.bind</groupId>
76                         <artifactId>jaxb-impl</artifactId>
77                         <version>2.2.11</version>
78                 </dependency>
79                 <dependency>
80                         <groupId>com.sun.xml.bind</groupId>
81                         <artifactId>jaxb-core</artifactId>
82                         <version>2.2.11</version>
83                 </dependency>
84                 <dependency>
85                         <groupId>com.sun.xml.bind</groupId>
86                         <artifactId>jaxb-xjc</artifactId>
87                         <version>2.2.11</version>
88                 </dependency>
89                 <dependency>
90                         <groupId>org.eclipse.persistence</groupId>
91                         <artifactId>org.eclipse.persistence.moxy</artifactId>
92                         <version>2.6.2</version>
93                         <scope>compile</scope>
94                 </dependency>
95                 <dependency>
96                         <groupId>com.sun.jersey</groupId>
97                         <artifactId>jersey-client</artifactId>
98                         <version>1.18</version>
99                 </dependency>
100                 <!-- Common logging framework -->
101                 <dependency>
102                         <groupId>org.openecomp.aai.logging-service</groupId>
103                         <artifactId>common-logging</artifactId>
104                         <version>1.0.0-SNAPSHOT</version>
105                 </dependency>
106                 <dependency>
107                         <groupId>org.openecomp.sdc</groupId>
108                     <artifactId>sdc-distribution-client</artifactId>
109                         <version>0.9.0</version>
110                 </dependency>
111                 <dependency>
112                         <groupId>org.json</groupId>
113                         <artifactId>json</artifactId>
114                         <version>20131018</version>
115                 </dependency>
116                 
117                 <dependency>
118                     <groupId>org.eclipse.jetty</groupId>
119                     <artifactId>jetty-security</artifactId>
120                     <version>9.3.8.RC0</version>
121                 </dependency>
122                 
123         <dependency>
124             <groupId>org.springframework</groupId>
125             <artifactId>spring-webmvc</artifactId>
126             <version>4.0.0.RELEASE</version>
127         </dependency>
128         <dependency>
129             <groupId>jline</groupId>
130             <artifactId>jline</artifactId>
131             <version>2.12.1</version>
132         </dependency>
133         
134         </dependencies>
135         
136         <!-- Plugins and repositories -->
137           <pluginRepositories>
138                 <pluginRepository>
139                            <id>central</id>
140                           <url>http://repo1.maven.org/maven2</url>
141                    </pluginRepository>
142                   <pluginRepository>
143                           <id>EvoSuite</id>
144                         <name>EvoSuite Repository</name>
145                          <url>http://www.evosuite.org/m2</url>
146                   </pluginRepository>
147           </pluginRepositories>
148            <repositories>
149                    <repository>
150                           <id>central</id>
151                           <name>Maven 2 repository 2</name>
152                           <url>http://repo2.maven.org/maven2/</url>
153                   </repository>
154               <repository>
155                          <id>ecomp-releases</id>
156                           <name>ECOMP Release Repository</name>
157                          <url>https://nexus.openecomp.org/content/repositories/releases/</url>
158                   </repository>
159                   <repository>
160                          <id>ecomp-snapshots</id>
161                           <name>ECOMP Snapshot Repository</name>
162                          <url>https://nexus.openecomp.org/content/repositories/snapshots/</url>
163                           <snapshots>
164             <updatePolicy>always</updatePolicy>
165         </snapshots>
166         <releases>
167             <updatePolicy>always</updatePolicy>
168         </releases>
169                   </repository>
170
171           </repositories>
172         
173         
174         <build>
175                 <plugins>
176                         <plugin>
177                                 <groupId>org.apache.maven.plugins</groupId>
178                                 <artifactId>maven-dependency-plugin</artifactId>
179                                 <version>2.5.1</version>
180                                 <executions>
181                                         <execution>
182                                                 <id>copy-agent</id>
183                                                 <phase>process-test-classes</phase>
184                                                 <goals>
185                                                         <goal>copy</goal>
186                                                 </goals>
187                                                 <configuration>
188                                                         <artifactItems>
189                                                                 <artifactItem>
190                                                                         <groupId>org.powermock</groupId>
191                                                                         <artifactId>powermock-module-javaagent</artifactId>
192                                                                         <version>1.6.2</version>
193                                                                         <outputDirectory>${project.build.directory}/agents</outputDirectory>
194                                                                         <destFileName>powermock-javaagent.jar</destFileName>
195                                                                 </artifactItem>
196                                                         </artifactItems>
197                                                 </configuration>
198                                         </execution>
199                                 </executions>
200                         </plugin>
201                         <plugin>
202                                 <groupId>org.apache.maven.plugins</groupId>
203                                 <artifactId>maven-surefire-plugin</artifactId>
204                                 <version>2.12.4</version>
205                                 <configuration>
206                                         <argLine>-javaagent:${project.build.directory}/agents/powermock-javaagent.jar
207                                                 -noverify</argLine>
208                                 </configuration>
209                         </plugin>
210                         <plugin>
211                                 <groupId>org.codehaus.mojo</groupId>
212                                 <artifactId>jaxb2-maven-plugin</artifactId>
213                                 <version>2.2</version>
214                                 <executions>
215                                         <execution>
216                                                 <id>xjc</id>
217                                                 <goals>
218                                                         <goal>xjc</goal>
219                                                 </goals>
220                                         </execution>
221                                 </executions>
222                                 <configuration>
223                                         <clearOutputDir>false</clearOutputDir>
224                                         <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
225                                         <sources>
226                                                 <source>${project.basedir}/src/main/resources/schema</source>
227                                         </sources>
228                                         <addGeneratedAnnotation>true</addGeneratedAnnotation>
229                                 </configuration>
230                         </plugin>
231                         <plugin>
232                                 <groupId>org.apache.maven.plugins</groupId>
233                                 <artifactId>maven-compiler-plugin</artifactId>
234                                 <version>3.1</version>
235                         </plugin>
236                 
237                         <!-- Checkstyle plugin - used to report on compliance with -->
238                         <!-- the Google style guide. -->
239                         <plugin>
240                                 <groupId>org.apache.maven.plugins</groupId>
241                                 <artifactId>maven-site-plugin</artifactId>
242                                 <version>3.3</version>
243                                 <configuration>
244                                         <reportPlugins>
245                                                 <plugin>
246                                                         <groupId>org.apache.maven.plugins</groupId>
247                                                         <artifactId>maven-checkstyle-plugin</artifactId>
248                                                         <version>2.17</version>
249                                                         <reportSets>
250                                                                 <reportSet>
251                                                                         <reports>
252                                                                                 <report>checkstyle</report>
253                                                                         </reports>
254                                                                 </reportSet>
255                                                         </reportSets>
256                                                 </plugin>
257                                         </reportPlugins>
258                                 </configuration>
259                         </plugin>
260                         
261             <!-- license plugin -->
262             <plugin>
263               <groupId>org.codehaus.mojo</groupId>
264               <artifactId>license-maven-plugin</artifactId>
265               <version>1.10</version>
266               <configuration>
267                 <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
268                 <excludes>
269                   <exclude>**.json</exclude>
270                   <exclude>**.properties</exclude>
271                 </excludes>
272                 <processStartTag>============LICENSE_START=======================================================</processStartTag>
273                 <processEndTag>============LICENSE_END=========================================================</processEndTag>
274                 <sectionDelimiter>================================================================================</sectionDelimiter>
275                 <licenseName>apache_v2</licenseName>
276                 <inceptionYear>2017</inceptionYear>
277                 <organizationName>AT&amp;T Intellectual Property. All rights reserved.</organizationName>
278                 <projectName>MODEL LOADER SERVICE</projectName>
279                 <canUpdateCopyright>true</canUpdateCopyright>
280                 <canUpdateDescription>true</canUpdateDescription>
281                 <canUpdateLicense>true</canUpdateLicense>
282                 <emptyLineAfterHeader>true</emptyLineAfterHeader>
283                 <roots>
284                   <root>.</root>
285                 </roots>
286                 <excludes>
287                   <exclude>**/*.json</exclude>
288                 </excludes>
289                 <extraExtensions>
290                   <route>xml</route>
291                   <props>properties</props>
292                   <xsd>xml</xsd>
293                   <txt>java</txt>
294                 </extraExtensions>
295               </configuration>
296               <executions>
297                 <execution>
298                   <id>first</id>
299                   <goals>
300                     <goal>update-file-header</goal>
301                   </goals>
302                   <phase>process-sources</phase>
303                 </execution>
304               </executions>
305             </plugin>
306              <plugin>
307                 <groupId>org.apache.maven.plugins</groupId>
308                 <artifactId>maven-deploy-plugin</artifactId>                    
309                 <configuration>
310                 <skip>true</skip>
311                 </configuration>
312              </plugin>
313                 </plugins>              
314         </build>
315         
316         <profiles>
317            <profile>
318               <id>docker</id>
319               <build>
320                <defaultGoal>docker:build</defaultGoal>
321                  <plugins>
322                         <plugin>
323                                 <groupId>org.apache.maven.plugins</groupId>
324                                 <artifactId>maven-resources-plugin</artifactId>
325                                 <version>2.7</version>
326                                 <executions>
327                                         <execution>
328                                                 <id>copy-docker-file</id>
329                                                 <phase>package</phase>
330                                                 <goals>
331                                                         <goal>copy-resources</goal>
332                                                 </goals>
333                                                 <configuration>
334                                                         <outputDirectory>target</outputDirectory>
335                                                         <overwrite>true</overwrite>
336                                                         <resources>
337                                                                 <resource>
338                                                                         <directory>${basedir}/src/main/docker</directory>
339                                                                         <filtering>true</filtering>
340                                                                         <includes>
341                                                                                 <include>**/*</include>
342                                                                         </includes>
343                                                                 </resource>
344                                                         </resources>
345                                                 </configuration>
346                                         </execution>
347                                 </executions>
348                         </plugin>
349                         <plugin>
350                                 <groupId>com.spotify</groupId>
351                                 <artifactId>docker-maven-plugin</artifactId>
352                                 <version>0.4.11</version>
353                                 <configuration>         
354                                         <serverId>nexus3.openecomp.org:10003</serverId>
355                                         <imageName>${docker.registry}/ecomp/${project.artifactId}</imageName>                                   
356                                         <dockerDirectory>${docker.location}</dockerDirectory>
357                                         <imageTags>
358                                                 <imageTag>${docker.imagetag}</imageTag>
359                                                 <imageTag>latest</imageTag>
360                                         </imageTags>
361                                         <forceTags>true</forceTags>
362                                 </configuration>
363                         </plugin>
364                  </plugins>
365               </build>
366            </profile>
367         </profiles>
368         
369 </project>