Fix: Use JDK17 in maven build GHA
[oparent.git] / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3    Copyright (c) 2016-2018 Huawei Technologies Co., Ltd.
4    Modifications copyright (C) 2017-2019 AT&T Intellectual Property
5    Modifications Copyright (C) 2020 Bell Canada.
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 -->
19 <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">
20   <modelVersion>4.0.0</modelVersion>
21   <name>oparent</name>
22   <groupId>org.onap.oparent</groupId>
23   <artifactId>version</artifactId>
24   <version>3.3.2-SNAPSHOT</version>
25   <packaging>pom</packaging>
26   <modules>
27     <!-- oparent tools -->
28     <module>checkstyle</module>
29     <module>license</module>
30     <module>oparent</module>
31     <module>oparent-python</module>
32     <module>dependencies</module>
33     <module>dependencies-clm</module>
34   </modules>
35   <properties>
36     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
37     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
38     <!-- sitePath may be overridden in the inheriting POM if desired -->
39     <sitePath>/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</sitePath>
40     <maven.compiler.release>11</maven.compiler.release>
41     <sonar.scanner.version>3.7.0.1746</sonar.scanner.version>
42
43     <!-- 
44        In the java 8 version of oparent there were two variables defined for 1.8 source and target. These are no longer
45        applicable in Java 11 but you may be referencing them in your child poms so review and update as appropriate.
46          <maven.compiler.source>1.8</maven.compiler.source>
47          <maven.compiler.target>1.8</maven.compiler.target>
48     -->
49     <!--
50         The following properties should be defined in your own ~/.m2/settings.xml based on your own build infastructure setup.
51         See the settings.xml in this directory for default settings based on the Linux Foundation ONAP infrastructure.
52
53     <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
54     <onap.nexus.rawrepo.baseurl.upload>https://nexus.onap.org/content/sites/raw</onap.nexus.rawrepo.baseurl.upload>
55     <onap.nexus.rawrepo.baseurl.download>https://nexus.onap.org/service/local/repositories/raw/content</onap.nexus.rawrepo.baseurl.download>
56     <onap.nexus.rawrepo.serverid>ecomp-raw</onap.nexus.rawrepo.serverid>
57     <onap.nexus.dockerregistry.daily>nexus3.onap.org:10003</onap.nexus.dockerregistry.daily>
58     <onap.nexus.dockerregistry.release>nexus3.onap.org:10002</onap.nexus.dockerregistry.release>
59     <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
60     <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
61     -->
62   </properties>
63   <distributionManagement>
64     <repository>
65       <id>ecomp-releases</id>
66       <url>${onap.nexus.url}/content/repositories/releases</url>
67     </repository>
68     <snapshotRepository>
69       <id>ecomp-snapshots</id>
70       <url>${onap.nexus.url}/content/repositories/snapshots</url>
71     </snapshotRepository>
72   </distributionManagement>
73   <build>
74     <pluginManagement>
75       <plugins>
76         <plugin>
77             <groupId>org.apache.maven.plugins</groupId>
78             <artifactId>maven-compiler-plugin</artifactId>
79             <version>3.8.0</version>
80             <configuration>
81                <release>${maven.compiler.release}</release>
82             </configuration>
83         </plugin>
84         <plugin>
85             <groupId>org.codehaus.mojo</groupId>
86             <artifactId>versions-maven-plugin</artifactId>
87             <version>2.7</version>
88             <configuration>
89                <generateBackupPoms>false</generateBackupPoms>
90             </configuration>
91         </plugin>
92         <plugin>
93           <groupId>org.apache.maven.plugins</groupId>
94           <artifactId>maven-deploy-plugin</artifactId>
95           <!-- This version supports the "deployAtEnd" parameter -->
96           <version>2.8</version>
97           <configuration>
98             <skip/>
99           </configuration>
100         </plugin>
101         <plugin>
102           <groupId>org.apache.maven.plugins</groupId>
103           <artifactId>maven-site-plugin</artifactId>
104           <version>3.6</version>
105           <dependencies>
106             <dependency>
107               <groupId>org.apache.maven.wagon</groupId>
108               <artifactId>wagon-webdav-jackrabbit</artifactId>
109               <version>3.4.3</version>
110             </dependency>
111           </dependencies>
112         </plugin>
113         <plugin>
114           <groupId>org.apache.maven.plugins</groupId>
115           <artifactId>maven-enforcer-plugin</artifactId>
116           <version>3.0.0-M2</version>
117           <executions>
118             <execution>
119               <id>enforce-property</id>
120               <goals>
121                 <goal>enforce</goal>
122               </goals>
123               <configuration>
124                 <rules>
125                   <requireProperty>
126                     <property>onap.nexus.url</property>
127                     <message>You must set a onap.nexus.url property in your ~/.m2/settings.xml.  See oparent/settings.xml for an example.</message>
128                   </requireProperty>
129                 </rules>
130                 <fail>true</fail>
131               </configuration>
132             </execution>
133             <execution>
134               <id>enforce-no-snapshots</id>
135               <goals>
136                 <goal>enforce</goal>
137               </goals>
138               <configuration>
139                 <rules>
140                   <requireReleaseDeps>
141                     <failWhenParentIsSnapshot>false</failWhenParentIsSnapshot>
142                     <onlyWhenRelease>true</onlyWhenRelease>
143                     <level>ERROR</level>
144                   </requireReleaseDeps>
145                 </rules>
146               </configuration>
147             </execution>
148           </executions>
149         </plugin>
150         <!-- https://mvnrepository.com/artifact/org.sonarsource.scanner.maven/sonar-maven-plugin -->
151         <plugin>
152           <groupId>org.sonarsource.scanner.maven</groupId>
153           <artifactId>sonar-maven-plugin</artifactId>
154           <version>${sonar.scanner.version}</version>
155         </plugin>
156         <!--
157         Using https://code.revelc.net/formatter-maven-plugin/ for Eclipse formatter
158         Using https://github.com/diffplug/spotless/tree/master/plugin-maven for import order
159         Use in combination to rewrite code and imports, then checkstyle
160
161         Be sure to override ${project.parent.basedir} in order to find the XML file
162
163         1st - your project should be inheriting from this oparent java dependency
164         2nd - go into your project's source directory
165         3rd - type in the following and make sure you set the path to where you have oparent cloned and its
166               onap-java-formatter.xml file
167
168         mvn formatter:format spotless:apply process-sources -Dproject.parent.basedir=TODO
169         -->
170         <plugin>
171             <groupId>net.revelc.code.formatter</groupId>
172             <artifactId>formatter-maven-plugin</artifactId>
173             <version>2.11.0</version>
174             <configuration>
175                 <configFile>${project.parent.basedir}/onap-java-formatter.xml</configFile>
176             </configuration>
177             <!-- https://code.revelc.net/formatter-maven-plugin/
178                  use mvn formatter:format to rewrite source files
179                  use mvn formatter:validate to validate source files -->
180         </plugin>
181         <plugin>
182             <groupId>com.diffplug.spotless</groupId>
183             <artifactId>spotless-maven-plugin</artifactId>
184             <version>1.26.1</version>
185             <configuration>
186                 <java>
187                     <importOrder>
188                         <order>com,java,javax,org</order>
189                     </importOrder>
190                 </java>
191             </configuration>
192             <!-- https://github.com/diffplug/spotless/tree/master/plugin-maven
193                  use mvn spotless:apply to rewrite source files
194                  use mvn spotless:check to validate source files -->
195         </plugin>
196       </plugins>
197     </pluginManagement>
198     <plugins>
199       <plugin>
200         <groupId>org.apache.maven.plugins</groupId>
201         <artifactId>maven-deploy-plugin</artifactId>
202       </plugin>
203       <plugin>
204         <groupId>org.apache.maven.plugins</groupId>
205         <artifactId>maven-site-plugin</artifactId>
206       </plugin>
207       <plugin>
208         <groupId>org.apache.maven.plugins</groupId>
209         <artifactId>maven-enforcer-plugin</artifactId>
210       </plugin>
211     </plugins>
212   </build>
213 </project>