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