Remove config for version-check plugin
[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.0.0-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.7.7.201606060606</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-SNAPSHOT</version>
272         </dependency>
273       </dependencies>
274     </profile>
275   </profiles>
276   <build>
277     <pluginManagement>
278       <plugins>
279         <plugin>
280           <artifactId>maven-checkstyle-plugin</artifactId>
281           <version>2.17</version>
282           <dependencies>
283             <dependency>
284               <groupId>org.onap.oparent</groupId>
285               <artifactId>checkstyle</artifactId>
286               <version>1.0.0-SNAPSHOT</version>
287             </dependency>
288           </dependencies>
289           <executions>
290             <execution>
291               <id>check-license</id>
292               <goals>
293                 <goal>check</goal>
294               </goals>
295               <phase>process-sources</phase>
296               <configuration>
297                 <configLocation>onap-checkstyle/check-license.xml</configLocation>
298                 <headerLocation>onap-checkstyle/apache-license-2.regexp.txt</headerLocation>
299                 <includeResources>false</includeResources>
300                 <includeTestSourceDirectory>true</includeTestSourceDirectory>
301                 <includeTestResources>false</includeTestResources>
302                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
303                 <excludes>
304                 </excludes>
305                 <failsOnError>false</failsOnError>
306                 <consoleOutput>true</consoleOutput>
307               </configuration>
308             </execution>
309             <execution>
310               <id>check-style</id>
311               <goals>
312                 <goal>check</goal>
313               </goals>
314               <phase>process-sources</phase>
315               <configuration>
316                 <!-- Use Google Java Style Guide:
317                      https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
318                      with minor changes -->
319                 <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
320                 <!-- <sourceDirectory> is needed so that checkstyle ignores the generated sources directory -->
321                 <sourceDirectory>${project.build.sourceDirectory}/src/main/java</sourceDirectory>
322                 <includeResources>true</includeResources>
323                 <includeTestSourceDirectory>true</includeTestSourceDirectory>
324                 <includeTestResources>true</includeTestResources>
325                 <excludes>
326                 </excludes>
327                 <failsOnError>false</failsOnError>
328                 <consoleOutput>true</consoleOutput>
329               </configuration>
330             </execution>
331           </executions>
332         </plugin>
333         <plugin>
334           <groupId>org.jacoco</groupId>
335           <artifactId>jacoco-maven-plugin</artifactId>
336           <version>${jacoco.version}</version>
337           <configuration>
338             <!-- Note: This exclusion list should match <sonar.exclusions>
339          property above -->
340             <excludes>
341               <exclude>**/gen/**</exclude>
342               <exclude>**/generated-sources/**</exclude>
343               <exclude>**/yang-gen/**</exclude>
344               <exclude>**/pax/**</exclude>
345             </excludes>
346           </configuration>
347           <executions>
348             <!--
349         Prepares the property pointing to the JaCoCo runtime agent which
350         is passed as VM argument when Maven the Surefire plugin is executed.
351         -->
352             <execution>
353               <id>pre-unit-test</id>
354               <goals>
355                 <goal>prepare-agent</goal>
356               </goals>
357               <configuration>
358                 <!-- Sets the path to the file which contains the execution data. -->
359                 <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>
360                 <!--
361             Sets the name of the property containing the settings
362             for JaCoCo runtime agent.
363         -->
364                 <propertyName>surefireArgLine</propertyName>
365               </configuration>
366             </execution>
367             <!--
368         Ensures that the code coverage report for unit tests is created after
369         unit tests have been run.
370         -->
371             <execution>
372               <id>post-unit-test</id>
373               <phase>test</phase>
374               <goals>
375                 <goal>report</goal>
376               </goals>
377               <configuration>
378                 <!-- Sets the path to the file which contains the execution data. -->
379                 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
380                 <!-- Sets the output directory for the code coverage report. -->
381                 <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
382               </configuration>
383             </execution>
384             <execution>
385               <id>pre-integration-test</id>
386               <phase>pre-integration-test</phase>
387               <goals>
388                 <goal>prepare-agent</goal>
389               </goals>
390               <configuration>
391                 <!-- Sets the path to the file which contains the execution data. -->
392                 <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>
393                 <!--
394             Sets the name of the property containing the settings
395             for JaCoCo runtime agent.
396         -->
397                 <propertyName>failsafeArgLine</propertyName>
398               </configuration>
399             </execution>
400             <!--
401         Ensures that the code coverage report for integration tests after
402         integration tests have been run.
403         -->
404             <execution>
405               <id>post-integration-test</id>
406               <phase>post-integration-test</phase>
407               <goals>
408                 <goal>report</goal>
409               </goals>
410               <configuration>
411                 <!-- Sets the path to the file which contains the execution data. -->
412                 <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>
413                 <!-- Sets the output directory for the code coverage report. -->
414                 <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
415               </configuration>
416             </execution>
417           </executions>
418         </plugin>
419         <plugin>
420           <groupId>org.apache.maven.plugins</groupId>
421           <artifactId>maven-surefire-plugin</artifactId>
422           <version>2.19.1</version>
423           <configuration>
424             <!-- Sets the VM argument line used when unit tests are run. -->
425             <argLine>${surefireArgLine}</argLine>
426             <!-- Excludes integration tests when unit tests are run. -->
427             <excludes>
428               <exclude>**/IT*.java</exclude>
429             </excludes>
430           </configuration>
431         </plugin>
432         <plugin>
433           <groupId>org.apache.maven.plugins</groupId>
434           <artifactId>maven-failsafe-plugin</artifactId>
435           <version>2.19.1</version>
436           <executions>
437             <!--
438         Ensures that both integration-test and verify goals of the Failsafe Maven
439         plugin are executed.
440         -->
441             <execution>
442               <id>integration-tests</id>
443               <goals>
444                 <goal>integration-test</goal>
445                 <goal>verify</goal>
446               </goals>
447               <configuration>
448                 <!-- Sets the VM argument line used when integration tests are run. -->
449                 <argLine>${failsafeArgLine}</argLine>
450               </configuration>
451             </execution>
452           </executions>
453         </plugin>
454         <!-- https://mvnrepository.com/artifact/org.sonarsource.scanner.maven/sonar-maven-plugin -->
455         <plugin>
456           <groupId>org.sonarsource.scanner.maven</groupId>
457           <artifactId>sonar-maven-plugin</artifactId>
458           <version>3.3.0.603</version>
459         </plugin>
460       </plugins>
461     </pluginManagement>
462     <plugins>
463       <plugin>
464         <artifactId>maven-checkstyle-plugin</artifactId>
465       </plugin>
466       <plugin>
467         <groupId>org.codehaus.mojo</groupId>
468         <artifactId>build-helper-maven-plugin</artifactId>
469         <version>1.12</version>
470       </plugin>
471       <!-- Jacoco / Sonar -->
472       <plugin>
473         <groupId>org.jacoco</groupId>
474         <artifactId>jacoco-maven-plugin</artifactId>
475       </plugin>
476       <plugin>
477         <groupId>org.apache.maven.plugins</groupId>
478         <artifactId>maven-surefire-plugin</artifactId>
479       </plugin>
480       <plugin>
481         <groupId>org.apache.maven.plugins</groupId>
482         <artifactId>maven-failsafe-plugin</artifactId>
483       </plugin>
484     </plugins>
485   </build>
486 </project>