Version bump oparent to 1.2.3-SNAPSHOT
[oparent.git] / oparent / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3    Copyright (c) 2016-2017 Huawei Technologies Co., Ltd.
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 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
18   <modelVersion>4.0.0</modelVersion>
19   <parent>
20     <groupId>org.onap.oparent</groupId>
21     <artifactId>version</artifactId>
22     <version>1.2.3-SNAPSHOT</version>
23     <relativePath>..</relativePath>
24   </parent>
25   <artifactId>oparent</artifactId>
26   <name>oparent/oparent</name>
27   <packaging>pom</packaging>
28   <scm>
29     <connection>scm:git:ssh://git.onap.org:29418/oparent.git</connection>
30     <developerConnection>scm:git:ssh://git.onap.org:29418/oparent.git</developerConnection>
31     <tag>HEAD</tag>
32     <url>https://wiki.onap.org/display/DW/Integration+Project</url>
33   </scm>
34   <properties>
35     <jacoco.version>0.8.2</jacoco.version>
36     <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
37     <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
38     <!-- Default Sonar configuration -->
39     <sonar.jacoco.reportPath>target/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath>
40     <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
41     <!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
42     <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
43     <!-- If following file exist, auto-generation of swagger.json will be done -->
44     <swagger-properties>${basedir}/src/main/resources/swagger.properties</swagger-properties>
45     <!-- If following file exist, auto-generation of sdk will be done -->
46     <swagger-json>${basedir}/src/main/resources/swagger.json</swagger-json>
47   </properties>
48   <profiles>
49     <profile>
50       <id>generate-json</id>
51       <activation>
52         <file>
53           <exists>${swagger-properties}</exists>
54         </file>
55         <property>
56           <name>swagger-sdk.generate-json</name>
57         </property>
58       </activation>
59       <build>
60         <plugins>
61           <plugin>
62             <groupId>org.codehaus.mojo</groupId>
63             <artifactId>properties-maven-plugin</artifactId>
64             <version>1.0.0</version>
65             <executions>
66               <execution>
67                 <phase>initialize</phase>
68                 <goals>
69                   <goal>read-project-properties</goal>
70                 </goals>
71                 <configuration>
72                   <files>
73                     <file>${basedir}/src/main/resources/swagger.properties</file>
74                   </files>
75                 </configuration>
76               </execution>
77             </executions>
78           </plugin>
79           <plugin>
80             <groupId>com.github.kongchen</groupId>
81             <artifactId>swagger-maven-plugin</artifactId>
82             <version>3.1.4</version>
83             <configuration>
84               <apiSources>
85                 <apiSource>
86                   <locations>${api-rest-package}</locations>
87                   <schemes>http,https</schemes>
88                   <host>${api-host-ip}:${api-host-port}</host>
89                   <basePath>${api-base-path}</basePath>
90                   <info>
91                     <title>${api-title}</title>
92                     <version>${api-version}</version>
93                     <description>${api-description}</description>
94                     <license>
95                       <name>${api-license}</name>
96                     </license>
97                   </info>
98                   <swaggerDirectory>${basedir}/src/main/resources</swaggerDirectory>
99                 </apiSource>
100               </apiSources>
101             </configuration>
102             <executions>
103               <execution>
104                 <phase>compile</phase>
105                 <goals>
106                   <goal>generate</goal>
107                 </goals>
108               </execution>
109             </executions>
110           </plugin>
111           <plugin>
112             <groupId>org.apache.maven.plugins</groupId>
113             <artifactId>maven-install-plugin</artifactId>
114             <version>2.3.1</version>
115             <executions>
116               <execution>
117                 <id>install-file-id</id>
118                 <phase>install</phase>
119                 <goals>
120                   <goal>install-file</goal>
121                 </goals>
122                 <configuration>
123                   <file>${basedir}/src/main/resources/swagger.json</file>
124                   <groupId>${project.groupId}</groupId>
125                   <artifactId>${project.artifactId}-swagger-schema</artifactId>
126                   <version>${project.version}</version>
127                   <packaging>json</packaging>
128                 </configuration>
129               </execution>
130             </executions>
131           </plugin>
132         </plugins>
133       </build>
134     </profile>
135     <profile>
136       <id>generate-sdk</id>
137       <activation>
138         <file>
139           <exists>${swagger-json}</exists>
140         </file>
141         <property>
142           <name>swagger-sdk.generate-java-sdk</name>
143         </property>
144       </activation>
145       <build>
146         <plugins>
147           <plugin>
148             <groupId>org.apache.maven.plugins</groupId>
149             <artifactId>maven-antrun-plugin</artifactId>
150             <version>1.8</version>
151             <executions>
152               <execution>
153                 <phase>initialize</phase>
154                 <id>ant-create-script</id>
155                 <configuration>
156                   <exportAntProperties>true</exportAntProperties>
157                   <tasks>
158                     <taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="maven.plugin.classpath"/>
159                     <condition property="is_windows" value="true">
160                       <os family="windows"/>
161                     </condition>
162                     <condition property="isLinux" value="true">
163                       <os family="unix"/>
164                     </condition>
165                     <if>
166                       <equals arg1="${is_windows}" arg2="true"/>
167                       <then>
168                         <property name="swagger.sdk.script.file" value="generated-source-script.bat"/>
169                         <echo file="${project.build.directory}${file.separator}generated-source-script.bat" append="true" message="cd ${project.build.directory}${file.separator}generated-sources${line.separator}"/>
170                         <echo file="${project.build.directory}${file.separator}generated-source-script.bat" append="true" message="mvn clean install -Dmaven.test.skip=true${line.separator}"/>
171                       </then>
172                       <else>
173                         <property name="swagger.sdk.script.file" value="generated-source-script.sh"/>
174                         <echo file="${project.build.directory}${file.separator}generated-source-script.sh" append="true" message="cd ${project.build.directory}${file.separator}generated-sources${line.separator}"/>
175                         <echo file="${project.build.directory}${file.separator}generated-source-script.sh" append="true" message="mvn clean install -Dmaven.test.skip=true${line.separator}"/>
176                         <chmod file="${project.build.directory}${file.separator}generated-source-script.sh" perm="755"/>
177                       </else>
178                     </if>
179                   </tasks>
180                 </configuration>
181                 <goals>
182                   <goal>run</goal>
183                 </goals>
184               </execution>
185             </executions>
186             <dependencies>
187               <dependency>
188                 <groupId>ant-contrib</groupId>
189                 <artifactId>ant-contrib</artifactId>
190                 <version>1.0b3</version>
191                 <exclusions>
192                   <exclusion>
193                     <artifactId>ant</artifactId>
194                     <groupId>ant</groupId>
195                   </exclusion>
196                 </exclusions>
197               </dependency>
198             </dependencies>
199           </plugin>
200           <plugin>
201             <groupId>io.swagger</groupId>
202             <artifactId>swagger-codegen-maven-plugin</artifactId>
203             <version>2.2.1</version>
204             <executions>
205               <execution>
206                 <goals>
207                   <goal>generate</goal>
208                 </goals>
209                 <configuration>
210                   <inputSpec>${basedir}/src/main/resources/swagger.json</inputSpec>
211                   <output>${project.build.directory}/generated-sources</output>
212                   <language>java</language>
213                   <configOptions>
214                     <dateLibrary>joda</dateLibrary>
215                   </configOptions>
216                   <library>jersey2</library>
217                   <groupId>${project.groupId}</groupId>
218                   <artifactId>${project.artifactId}-java-sdk</artifactId>
219                   <artifactVersion>${project.version}</artifactVersion>
220                   <modelPackage>${project.groupId}.${project.artifactId}.client.model</modelPackage>
221                   <apiPackage>${project.groupId}.${project.artifactId}.client.api</apiPackage>
222                   <invokerPackage>${project.groupId}.${project.artifactId}.client.invoker</invokerPackage>
223                 </configuration>
224               </execution>
225             </executions>
226           </plugin>
227           <plugin>
228             <artifactId>exec-maven-plugin</artifactId>
229             <groupId>org.codehaus.mojo</groupId>
230             <version>1.5.0</version>
231             <executions>
232               <execution>
233                 <id>swagger-generate-sources</id>
234                 <phase>generate-sources</phase>
235                 <goals>
236                   <goal>exec</goal>
237                 </goals>
238                 <configuration>
239                   <executable>${project.build.directory}${file.separator}${swagger.sdk.script.file}</executable>
240                 </configuration>
241               </execution>
242             </executions>
243           </plugin>
244           <plugin>
245             <groupId>org.apache.maven.plugins</groupId>
246             <artifactId>maven-clean-plugin</artifactId>
247             <version>3.0.0</version>
248             <executions>
249               <execution>
250                 <id>clean-generated-files</id>
251                 <phase>generate-sources</phase>
252                 <goals>
253                   <goal>clean</goal>
254                 </goals>
255                 <configuration>
256                   <filesets>
257                     <fileset>
258                       <directory>${project.build.directory}/generated-sources</directory>
259                     </fileset>
260                   </filesets>
261                 </configuration>
262               </execution>
263             </executions>
264           </plugin>
265         </plugins>
266       </build>
267       <dependencies>
268         <dependency>
269           <groupId>org.onap.msb.swagger-sdk</groupId>
270           <artifactId>swagger-sdk</artifactId>
271           <version>1.0.0</version>
272         </dependency>
273       </dependencies>
274     </profile>
275   </profiles>
276   <dependencyManagement>
277     <dependencies>
278       <dependency>
279         <groupId>org.onap.oparent</groupId>
280         <artifactId>dependencies</artifactId>
281         <version>1.2.3-SNAPSHOT</version>
282         <type>pom</type>
283         <scope>import</scope>
284       </dependency>
285     </dependencies>
286   </dependencyManagement>
287   <build>
288     <pluginManagement>
289       <plugins>
290         <plugin>
291           <groupId>org.jacoco</groupId>
292           <artifactId>jacoco-maven-plugin</artifactId>
293           <version>${jacoco.version}</version>
294           <configuration>
295             <!-- Note: This exclusion list should match <sonar.exclusions>
296          property above -->
297             <excludes>
298               <exclude>**/gen/**</exclude>
299               <exclude>**/generated-sources/**</exclude>
300               <exclude>**/yang-gen/**</exclude>
301               <exclude>**/pax/**</exclude>
302             </excludes>
303           </configuration>
304           <executions>
305             <!--
306         Prepares the property pointing to the JaCoCo runtime agent which
307         is passed as VM argument when Maven the Surefire plugin is executed.
308         -->
309             <execution>
310               <id>pre-unit-test</id>
311               <goals>
312                 <goal>prepare-agent</goal>
313               </goals>
314               <configuration>
315                 <!-- Sets the path to the file which contains the execution data. -->
316                 <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>
317                 <!--
318             Sets the name of the property containing the settings
319             for JaCoCo runtime agent.
320         -->
321                 <propertyName>surefireArgLine</propertyName>
322               </configuration>
323             </execution>
324             <!--
325         Ensures that the code coverage report for unit tests is created after
326         unit tests have been run.
327         -->
328             <execution>
329               <id>post-unit-test</id>
330               <phase>test</phase>
331               <goals>
332                 <goal>report</goal>
333               </goals>
334               <configuration>
335                 <!-- Sets the path to the file which contains the execution data. -->
336                 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
337                 <!-- Sets the output directory for the code coverage report. -->
338                 <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
339               </configuration>
340             </execution>
341             <execution>
342               <id>pre-integration-test</id>
343               <phase>pre-integration-test</phase>
344               <goals>
345                 <goal>prepare-agent</goal>
346               </goals>
347               <configuration>
348                 <!-- Sets the path to the file which contains the execution data. -->
349                 <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>
350                 <!--
351             Sets the name of the property containing the settings
352             for JaCoCo runtime agent.
353         -->
354                 <propertyName>failsafeArgLine</propertyName>
355               </configuration>
356             </execution>
357             <!--
358         Ensures that the code coverage report for integration tests after
359         integration tests have been run.
360         -->
361             <execution>
362               <id>post-integration-test</id>
363               <phase>post-integration-test</phase>
364               <goals>
365                 <goal>report</goal>
366               </goals>
367               <configuration>
368                 <!-- Sets the path to the file which contains the execution data. -->
369                 <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>
370                 <!-- Sets the output directory for the code coverage report. -->
371                 <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
372               </configuration>
373             </execution>
374           </executions>
375         </plugin>
376         <plugin>
377           <groupId>org.apache.maven.plugins</groupId>
378           <artifactId>maven-surefire-plugin</artifactId>
379           <version>2.22.0</version>
380           <configuration>
381             <!-- Sets the VM argument line used when unit tests are run. -->
382             <argLine>${surefireArgLine}</argLine>
383             <!-- Excludes integration tests when unit tests are run. -->
384             <excludes>
385               <exclude>**/IT*.java</exclude>
386             </excludes>
387           </configuration>
388         </plugin>
389         <plugin>
390           <groupId>org.apache.maven.plugins</groupId>
391           <artifactId>maven-failsafe-plugin</artifactId>
392           <version>2.22.0</version>
393           <executions>
394             <!--
395         Ensures that both integration-test and verify goals of the Failsafe Maven
396         plugin are executed.
397         -->
398             <execution>
399               <id>integration-tests</id>
400               <goals>
401                 <goal>integration-test</goal>
402                 <goal>verify</goal>
403               </goals>
404               <configuration>
405                 <!-- Sets the VM argument line used when integration tests are run. -->
406                 <argLine>${failsafeArgLine}</argLine>
407               </configuration>
408             </execution>
409           </executions>
410         </plugin>
411         <!-- https://mvnrepository.com/artifact/org.sonarsource.scanner.maven/sonar-maven-plugin -->
412         <plugin>
413           <groupId>org.sonarsource.scanner.maven</groupId>
414           <artifactId>sonar-maven-plugin</artifactId>
415           <version>3.2</version>
416         </plugin>
417       </plugins>
418     </pluginManagement>
419     <plugins>
420       <plugin>
421         <artifactId>maven-checkstyle-plugin</artifactId>
422         <version>2.17</version>
423         <dependencies>
424           <dependency>
425             <groupId>org.onap.oparent</groupId>
426             <artifactId>checkstyle</artifactId>
427             <version>1.2.3-SNAPSHOT</version>
428           </dependency>
429         </dependencies>
430         <executions>
431           <execution>
432             <id>onap-license</id>
433             <goals>
434               <goal>check</goal>
435             </goals>
436             <phase>process-sources</phase>
437             <configuration>
438               <configLocation>onap-checkstyle/check-license.xml</configLocation>
439               <includeResources>false</includeResources>
440               <includeTestSourceDirectory>true</includeTestSourceDirectory>
441               <includeTestResources>false</includeTestResources>
442               <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
443               <excludes>
444               </excludes>
445               <consoleOutput>true</consoleOutput>
446               <failsOnViolation>false</failsOnViolation>
447             </configuration>
448           </execution>
449           <execution>
450             <id>onap-java-style</id>
451             <goals>
452               <goal>check</goal>
453             </goals>
454             <phase>process-sources</phase>
455             <configuration>
456               <!-- Use Google Java Style Guide:
457                    https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
458                    with minor changes -->
459               <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
460               <!-- <sourceDirectory> is needed so that checkstyle ignores the generated sources directory -->
461               <sourceDirectory>${project.build.sourceDirectory}/src/main/java</sourceDirectory>
462               <includeResources>true</includeResources>
463               <includeTestSourceDirectory>true</includeTestSourceDirectory>
464               <includeTestResources>true</includeTestResources>
465               <excludes>
466               </excludes>
467               <consoleOutput>true</consoleOutput>
468               <failsOnViolation>false</failsOnViolation>
469             </configuration>
470           </execution>
471         </executions>
472       </plugin>
473       <plugin>
474         <groupId>org.codehaus.mojo</groupId>
475         <artifactId>build-helper-maven-plugin</artifactId>
476         <version>1.12</version>
477       </plugin>
478       <!-- Jacoco / Sonar -->
479       <plugin>
480         <groupId>org.jacoco</groupId>
481         <artifactId>jacoco-maven-plugin</artifactId>
482       </plugin>
483       <plugin>
484         <groupId>org.apache.maven.plugins</groupId>
485         <artifactId>maven-surefire-plugin</artifactId>
486       </plugin>
487       <plugin>
488         <groupId>org.apache.maven.plugins</groupId>
489         <artifactId>maven-failsafe-plugin</artifactId>
490       </plugin>
491     </plugins>
492   </build>
493 </project>