5aa4fb3c4c3740ea7d4ce7a90255d93c2fad1a5a
[honeycomb.git] / common / honeycomb-parent / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3   ~ Copyright (c) 2016 Cisco and/or its affiliates.
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"
18          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
19     <modelVersion>4.0.0</modelVersion>
20     <groupId>io.fd.honeycomb.common</groupId>
21     <artifactId>honeycomb-parent</artifactId>
22     <version>1.16.12-SNAPSHOT</version>
23     <packaging>pom</packaging>
24
25     <properties>
26         <nexusproxy>http://nexus.fd.io/content</nexusproxy>
27         <odl.nexusproxy>https://nexus.opendaylight.org/content</odl.nexusproxy>
28
29         <!-- Default Sonar configuration -->
30         <sonar-jacoco-listeners.version>2.4</sonar-jacoco-listeners.version>
31         <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
32         <sonar.jacoco.reportPath>target/code-coverage/jacoco.exec</sonar.jacoco.reportPath>
33         <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
34         <!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
35         <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**</sonar.exclusions>
36
37         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
38         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
39
40         <!-- ODL dependencies -->
41         <yangtools.version>0.8.2-Beryllium-SR2</yangtools.version>
42         <mdsal.version>2.0.2-Beryllium-SR2</mdsal.version>
43         <mdsal.controller.version>1.3.2-Beryllium-SR2</mdsal.controller.version>
44         <mdsalmodel.version>0.8.2-Beryllium-SR2</mdsalmodel.version>
45         <netconf.version>1.0.2-Beryllium-SR2</netconf.version>
46         <restconf.version>1.3.2-Beryllium-SR2</restconf.version>
47         <salGeneratorPath>target/generated-sources/mdsal-binding</salGeneratorPath>
48
49         <!-- dependencies -->
50         <junit.version>4.11</junit.version>
51         <mockito.version>1.9.5</mockito.version>
52         <hamcrest.version>1.3</hamcrest.version>
53         <guava.version>18.0</guava.version>
54
55         <!-- plugins -->
56         <checkstyle.version>2.16</checkstyle.version>
57         <maven.javadoc.version>2.10.3</maven.javadoc.version>
58         <jacoco.version>0.7.2.201409121644</jacoco.version>
59         <enforcer.version>1.4</enforcer.version>
60         <maven.compile.plugin.version>3.3</maven.compile.plugin.version>
61         <maven.bundle.version>3.0.0</maven.bundle.version>
62
63         <!-- checkstyle -->
64         <checkstyle.header.file>APACHE_HEADER.txt</checkstyle.header.file>
65     </properties>
66
67     <organization>
68         <name>fd.io</name>
69         <url>https://fd.io</url>
70     </organization>
71
72     <licenses>
73         <license>
74             <name>Apache License, Version 2.0</name>
75             <url>http://www.apache.org/licenses/LICENSE-2.0</url>
76         </license>
77     </licenses>
78
79     <issueManagement>
80         <system>JIRA</system>
81         <url>https://jira.fd.io/</url>
82     </issueManagement>
83
84     <ciManagement>
85         <system>Jenkins</system>
86         <url>https://jenkins.fd.io/</url>
87     </ciManagement>
88
89     <dependencyManagement>
90         <dependencies>
91             <!-- ODL -->
92             <dependency>
93                 <groupId>org.opendaylight.yangtools</groupId>
94                 <artifactId>yangtools-artifacts</artifactId>
95                 <version>${yangtools.version}</version>
96                 <type>pom</type>
97                 <scope>import</scope>
98             </dependency>
99             <dependency>
100                 <groupId>org.opendaylight.controller</groupId>
101                 <artifactId>mdsal-artifacts</artifactId>
102                 <version>${mdsal.controller.version}</version>
103                 <type>pom</type>
104                 <scope>import</scope>
105             </dependency>
106             <dependency>
107                 <groupId>org.opendaylight.mdsal</groupId>
108                 <artifactId>mdsal-artifacts</artifactId>
109                 <version>${mdsal.version}</version>
110                 <type>pom</type>
111                 <scope>import</scope>
112             </dependency>
113             <dependency>
114                 <groupId>org.opendaylight.netconf</groupId>
115                 <artifactId>netconf-artifacts</artifactId>
116                 <version>${netconf.version}</version>
117                 <type>pom</type>
118                 <scope>import</scope>
119             </dependency>
120             <dependency>
121                 <groupId>org.opendaylight.netconf</groupId>
122                 <artifactId>restconf-artifacts</artifactId>
123                 <version>${restconf.version}</version>
124                 <type>pom</type>
125                 <scope>import</scope>
126             </dependency>
127             <dependency>
128                 <groupId>org.opendaylight.mdsal.model</groupId>
129                 <artifactId>mdsal-model-artifacts</artifactId>
130                 <version>${mdsalmodel.version}</version>
131                 <type>pom</type>
132                 <scope>import</scope>
133             </dependency>
134
135             <!-- Utilities -->
136             <dependency>
137                 <groupId>com.google.guava</groupId>
138                 <artifactId>guava</artifactId>
139                 <version>${guava.version}</version>
140             </dependency>
141
142             <!-- Testing Dependencies -->
143             <dependency>
144                 <groupId>junit</groupId>
145                 <artifactId>junit</artifactId>
146                 <version>${junit.version}</version>
147                 <scope>test</scope>
148             </dependency>
149             <!-- Dont use mockito-all, it has problematic dependency on harmcrest
150                 More details here - https://github.com/mockito/mockito/issues/324-->
151             <dependency>
152                 <groupId>org.mockito</groupId>
153                 <artifactId>mockito-core</artifactId>
154                 <version>${mockito.version}</version>
155                 <scope>test</scope>
156             </dependency>
157             <dependency>
158                 <groupId>org.hamcrest</groupId>
159                 <artifactId>hamcrest-all</artifactId>
160                 <version>${hamcrest.version}</version>
161                 <scope>test</scope>
162             </dependency>
163         </dependencies>
164     </dependencyManagement>
165
166     <build>
167         <pluginManagement>
168             <plugins>
169                 <!-- checkstyle -->
170                 <plugin>
171                     <artifactId>maven-checkstyle-plugin</artifactId>
172                     <version>${checkstyle.version}</version>
173                     <configuration>
174                         <!-- Override checkstyle configuration to fit Honeycomb coding style-->
175                         <configLocation>honeycomb-checkstyle.xml</configLocation>
176                         <includeTestResources>true</includeTestResources>
177                         <!--TODO HONEYCOMB-155 enable fail on violation after issues are resolved + set in as errors in checkstyle xml-->
178                         <excludes>
179                             org/opendaylight/yang/gen/**,
180                         </excludes>
181                     </configuration>
182                     <executions>
183
184                         <!-- Override license check configuration to fit Honeycomb coding style-->
185                         <execution>
186                             <id>check-license</id>
187                             <goals>
188                                 <goal>check</goal>
189                             </goals>
190                             <phase>process-sources</phase>
191                             <configuration>
192                                 <headerLocation>HONEYCOMB_LICENSE.txt</headerLocation>
193                                 <failOnViolation>true</failOnViolation>
194                                 <failsOnError>true</failsOnError>
195                                 <outputFile>${project.build.directory}/checkstyle-license-result.xml</outputFile>
196                             </configuration>
197                         </execution>
198
199                         <!-- Add logging checks from yangtools -->
200                         <execution>
201                             <id>check-logging</id>
202                             <goals>
203                                 <goal>check</goal>
204                             </goals>
205                             <phase>process-sources</phase>
206                             <configuration>
207                                 <failOnViolation>true</failOnViolation>
208                                 <configLocation>honeycomb-checkstyle-logging.xml</configLocation>
209                                 <consoleOutput>true</consoleOutput>
210                                 <includeTestSourceDirectory>true</includeTestSourceDirectory>
211                                 <sourceDirectory>${project.basedir}</sourceDirectory>
212                                 <includes>**\/*.java,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat,**\/*.yang</includes>
213                                 <excludes>
214                                     **\/target\/,**\/bin\/,**\/target-ide\/,**\/src/main/yang-gen-config\/,**\/src/main/yang-gen-sal\/,**\/src/main/xtend-gen\/,**\/src/main/yang\/
215                                 </excludes>
216                                 <outputFile>${project.build.directory}/checkstyle-logging-result.xml</outputFile>
217                             </configuration>
218                         </execution>
219                         <execution>
220                             <goals>
221                                 <goal>check</goal>
222                             </goals>
223                             <phase>process-sources</phase>
224                         </execution>
225                     </executions>
226                     <dependencies>
227                         <dependency>
228                             <groupId>io.fd.honeycomb.common</groupId>
229                             <artifactId>honeycomb-checkstyle</artifactId>
230                             <!-- Hardcoded version to prevent archetype generated projects to use their own project version -->
231                             <version>1.16.12-SNAPSHOT</version>
232                         </dependency>
233                         <!-- Necessary for logging checks -->
234                         <dependency>
235                             <groupId>org.opendaylight.yangtools</groupId>
236                             <artifactId>checkstyle-logging</artifactId>
237                             <version>${yangtools.version}</version>
238                         </dependency>
239                     </dependencies>
240                 </plugin>
241                 <!-- Deactivate strict java8 checks -->
242                 <!-- TODO HONEYCOMB-156 fix all the javadoc offenders of doclint -->
243                 <plugin>
244                     <groupId>org.apache.maven.plugins</groupId>
245                     <artifactId>maven-javadoc-plugin</artifactId>
246                     <version>${maven.javadoc.version}</version>
247                     <configuration>
248                         <additionalparam>-Xdoclint:none</additionalparam>
249                     </configuration>
250                 </plugin>
251                 <!-- jacoco test coverage for sonar -->
252                 <plugin>
253                     <groupId>org.jacoco</groupId>
254                     <artifactId>jacoco-maven-plugin</artifactId>
255                     <version>${jacoco.version}</version>
256                     <executions>
257                         <execution>
258                             <id>pre-unit-test</id>
259                             <goals>
260                                 <goal>prepare-agent</goal>
261                             </goals>
262                             <configuration>
263                                 <destFile>${sonar.jacoco.reportPath}</destFile>
264                             </configuration>
265                         </execution>
266                         <execution>
267                             <id>post-unit-test</id>
268                             <goals>
269                                 <goal>report</goal>
270                             </goals>
271                             <configuration>
272                                 <dataFile>${sonar.jacoco.reportPath}</dataFile>
273                             </configuration>
274                         </execution>
275                     </executions>
276                     <configuration>
277                         <excludes>
278                             <exclude>**/gen/**</exclude>
279                             <exclude>**/generated-sources/**</exclude>
280                             <exclude>**/yang-gen/**</exclude>
281                         </excludes>
282                     </configuration>
283                 </plugin>
284                 <!-- Enforce maven version -->
285                 <plugin>
286                     <groupId>org.apache.maven.plugins</groupId>
287                     <artifactId>maven-enforcer-plugin</artifactId>
288                     <version>${enforcer.version}</version>
289                     <executions>
290                         <execution>
291                             <id>enforce-maven</id>
292                             <configuration>
293                                 <rules>
294                                     <requireMavenVersion>
295                                         <version>3.1.1</version>
296                                     </requireMavenVersion>
297                                 </rules>
298                             </configuration>
299                             <goals>
300                                 <goal>enforce</goal>
301                             </goals>
302                         </execution>
303                     </executions>
304                 </plugin>
305                 <!-- Compile with google static analysis tool: error_prone -->
306                 <plugin>
307                     <groupId>org.apache.maven.plugins</groupId>
308                     <artifactId>maven-compiler-plugin</artifactId>
309                     <version>${maven.compile.plugin.version}</version>
310                     <configuration>
311                         <!-- Use google's error-prone static analysis-->
312                         <compilerId>javac-with-errorprone</compilerId>
313                         <forceJavacCompilerUse>true</forceJavacCompilerUse>
314                         <showWarnings>true</showWarnings>
315                         <source>1.8</source>
316                         <target>1.8</target>
317                     </configuration>
318                     <dependencies>
319                         <dependency>
320                             <groupId>org.codehaus.plexus</groupId>
321                             <artifactId>plexus-compiler-javac-errorprone</artifactId>
322                             <version>2.5</version>
323                         </dependency>
324                         <!-- override plexus-compiler-javac-errorprone's dependency on
325                              Error Prone with the latest version -->
326                         <dependency>
327                             <groupId>com.google.errorprone</groupId>
328                             <artifactId>error_prone_core</artifactId>
329                             <version>2.0.9</version>
330                         </dependency>
331                     </dependencies>
332                 </plugin>
333                 <plugin>
334                     <groupId>org.apache.felix</groupId>
335                     <artifactId>maven-bundle-plugin</artifactId>
336                     <version>${maven.bundle.version}</version>
337                     <extensions>true</extensions>
338                 </plugin>
339             </plugins>
340         </pluginManagement>
341         <plugins>
342             <plugin>
343                 <artifactId>maven-enforcer-plugin</artifactId>
344             </plugin>
345             <plugin>
346                 <artifactId>maven-checkstyle-plugin</artifactId>
347             </plugin>
348             <plugin>
349                 <artifactId>maven-dependency-plugin</artifactId>
350             </plugin>
351             <plugin>
352                 <artifactId>maven-compiler-plugin</artifactId>
353             </plugin>
354             <plugin>
355                 <groupId>org.jacoco</groupId>
356                 <artifactId>jacoco-maven-plugin</artifactId>
357             </plugin>
358             <plugin>
359                 <groupId>org.apache.felix</groupId>
360                 <artifactId>maven-bundle-plugin</artifactId>
361             </plugin>
362         </plugins>
363     </build>
364
365     <distributionManagement>
366         <repository>
367             <id>fdio-release</id>
368             <url>${nexusproxy}/repositories/fd.io.release/</url>
369         </repository>
370         <snapshotRepository>
371             <id>fdio-snapshot</id>
372             <url>${nexusproxy}/repositories/fd.io.snapshot/</url>
373         </snapshotRepository>
374     </distributionManagement>
375
376     <repositories>
377         <!-- Using only ODL stable releases -->
378         <repository>
379             <releases>
380                 <enabled>true</enabled>
381                 <updatePolicy>never</updatePolicy>
382             </releases>
383             <snapshots>
384                 <enabled>false</enabled>
385             </snapshots>
386             <id>opendaylight-mirror</id>
387             <name>opendaylight-mirror</name>
388             <url>${odl.nexusproxy}/repositories/public/</url>
389         </repository>
390     </repositories>
391 </project>