pom.xml revision 7236617f
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
20    <modelVersion>4.0.0</modelVersion>
21    <groupId>io.fd.honeycomb.common</groupId>
22    <artifactId>honeycomb-parent</artifactId>
23    <name>${project.artifactId}</name>
24    <version>1.16.12-SNAPSHOT</version>
25    <packaging>pom</packaging>
26    <prerequisites>
27        <maven>3.1.1</maven>
28    </prerequisites>
29
30    <properties>
31        <nexusproxy>http://nexus.fd.io/content</nexusproxy>
32        <odl.nexusproxy>https://nexus.opendaylight.org/content</odl.nexusproxy>
33
34        <!-- Default Sonar configuration -->
35        <sonar-jacoco-listeners.version>2.4</sonar-jacoco-listeners.version>
36        <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
37        <sonar.jacoco.reportPath>target/code-coverage/jacoco.exec</sonar.jacoco.reportPath>
38        <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
39        <!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
40        <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**</sonar.exclusions>
41
42        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
43        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
44
45        <!-- ODL dependencies -->
46        <yangtools.version>0.8.2-Beryllium-SR2</yangtools.version>
47        <mdsal.version>2.0.2-Beryllium-SR2</mdsal.version>
48        <mdsal.controller.version>1.3.2-Beryllium-SR2</mdsal.controller.version>
49        <mdsalmodel.version>0.8.2-Beryllium-SR2</mdsalmodel.version>
50        <netconf.version>1.0.2-Beryllium-SR2</netconf.version>
51        <restconf.version>1.3.2-Beryllium-SR2</restconf.version>
52        <salGeneratorPath>target/generated-sources/mdsal-binding</salGeneratorPath>
53
54        <!-- dependencies -->
55        <junit.version>4.11</junit.version>
56        <mockito.version>1.9.5</mockito.version>
57        <hamcrest.version>1.3</hamcrest.version>
58        <guava.version>18.0</guava.version>
59
60        <!-- plugins -->
61        <checkstyle.version>2.16</checkstyle.version>
62        <maven.javadoc.version>2.10.3</maven.javadoc.version>
63        <jacoco.version>0.7.2.201409121644</jacoco.version>
64        <enforcer.version>1.4</enforcer.version>
65        <maven.compile.plugin.version>3.3</maven.compile.plugin.version>
66        <maven.bundle.version>3.0.0</maven.bundle.version>
67
68        <!-- checkstyle -->
69        <checkstyle.header.file>APACHE_HEADER.txt</checkstyle.header.file>
70
71        <!-- site -->
72        <!-- skip location check = makes site exec faster -->
73        <dependency.locations.enabled>false</dependency.locations.enabled>
74        <project.info.report.version>2.9</project.info.report.version>
75        <maven.resources.version>2.6</maven.resources.version>
76        <maven.site.version>3.4</maven.site.version>
77        <!-- adoc -->
78        <asciidoctor.maven.plugin.version>1.5.3</asciidoctor.maven.plugin.version>
79        <asciidoctorj.diagram.version>1.3.1</asciidoctorj.diagram.version>
80
81        <!-- groovy -->
82        <maven.groovy.version>2.0</maven.groovy.version>
83        <groovy.version>2.4.7</groovy.version>
84        <groovy.eclipse.compiler.version>2.9.2-01</groovy.eclipse.compiler.version>
85        <groovy.eclipse.batch.version>2.4.3-01</groovy.eclipse.batch.version>
86
87        <docs.base.url>https://nexus.fd.io/content/sites/site</docs.base.url>
88        <docs.hc.folder>io/fd/honeycomb</docs.hc.folder>
89    </properties>
90
91    <organization>
92        <name>fd.io</name>
93        <url>https://fd.io</url>
94    </organization>
95
96    <licenses>
97        <license>
98            <name>Apache License, Version 2.0</name>
99            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
100        </license>
101    </licenses>
102
103    <issueManagement>
104        <system>JIRA</system>
105        <url>https://jira.fd.io/</url>
106    </issueManagement>
107
108    <ciManagement>
109        <system>Jenkins</system>
110        <url>https://jenkins.fd.io/</url>
111    </ciManagement>
112
113    <mailingLists>
114        <mailingList>
115            <name>HC dev</name>
116            <post>honeycomb-dev@fd.io</post>
117            <subscribe>https://lists.fd.io/mailman/listinfo/honeycomb-dev</subscribe>
118            <archive>https://lists.fd.io/pipermail/honeycomb-dev/</archive>
119        </mailingList>
120    </mailingLists>
121
122    <dependencyManagement>
123        <dependencies>
124            <!-- ODL -->
125            <dependency>
126                <groupId>org.opendaylight.yangtools</groupId>
127                <artifactId>yangtools-artifacts</artifactId>
128                <version>${yangtools.version}</version>
129                <type>pom</type>
130                <scope>import</scope>
131            </dependency>
132            <dependency>
133                <groupId>org.opendaylight.controller</groupId>
134                <artifactId>mdsal-artifacts</artifactId>
135                <version>${mdsal.controller.version}</version>
136                <type>pom</type>
137                <scope>import</scope>
138            </dependency>
139            <dependency>
140                <groupId>org.opendaylight.mdsal</groupId>
141                <artifactId>mdsal-artifacts</artifactId>
142                <version>${mdsal.version}</version>
143                <type>pom</type>
144                <scope>import</scope>
145            </dependency>
146            <dependency>
147                <groupId>org.opendaylight.netconf</groupId>
148                <artifactId>netconf-artifacts</artifactId>
149                <version>${netconf.version}</version>
150                <type>pom</type>
151                <scope>import</scope>
152            </dependency>
153            <dependency>
154                <groupId>org.opendaylight.netconf</groupId>
155                <artifactId>restconf-artifacts</artifactId>
156                <version>${restconf.version}</version>
157                <type>pom</type>
158                <scope>import</scope>
159            </dependency>
160            <dependency>
161                <groupId>org.opendaylight.mdsal.model</groupId>
162                <artifactId>mdsal-model-artifacts</artifactId>
163                <version>${mdsalmodel.version}</version>
164                <type>pom</type>
165                <scope>import</scope>
166            </dependency>
167
168            <!-- Utilities -->
169            <dependency>
170                <groupId>com.google.guava</groupId>
171                <artifactId>guava</artifactId>
172                <version>${guava.version}</version>
173            </dependency>
174
175            <!-- Testing Dependencies -->
176            <dependency>
177                <groupId>junit</groupId>
178                <artifactId>junit</artifactId>
179                <version>${junit.version}</version>
180                <scope>test</scope>
181            </dependency>
182            <!-- Dont use mockito-all, it has problematic dependency on harmcrest
183                More details here - https://github.com/mockito/mockito/issues/324-->
184            <dependency>
185                <groupId>org.mockito</groupId>
186                <artifactId>mockito-core</artifactId>
187                <version>${mockito.version}</version>
188                <scope>test</scope>
189            </dependency>
190            <dependency>
191                <groupId>org.hamcrest</groupId>
192                <artifactId>hamcrest-all</artifactId>
193                <version>${hamcrest.version}</version>
194                <scope>test</scope>
195            </dependency>
196        </dependencies>
197    </dependencyManagement>
198
199    <build>
200        <pluginManagement>
201            <plugins>
202                <!-- checkstyle -->
203                <plugin>
204                    <artifactId>maven-checkstyle-plugin</artifactId>
205                    <version>${checkstyle.version}</version>
206                    <configuration>
207                        <!-- Override checkstyle configuration to fit Honeycomb coding style-->
208                        <configLocation>honeycomb-checkstyle.xml</configLocation>
209                        <includeTestResources>true</includeTestResources>
210                        <!--TODO HONEYCOMB-155 enable fail on violation after issues are resolved + set in as errors in checkstyle xml-->
211
212                        <includes>**\/*.java,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat,**\/*.yang</includes>
213                        <excludes>**\/target\/,
214                            **\/bin\/,
215                            **\/target-ide\/,
216                            **\/src/main/yang-gen-config\/,
217                            org/opendaylight/yang/gen/**,
218                            **\/src/main/yang-gen-sal\/,
219                            **\/src/main/xtend-gen\/,
220                            **\/src/main/yang\/,
221                            **\/archetype-resources\/</excludes>
222                    </configuration>
223                    <executions>
224
225                        <!-- Override license check configuration to fit Honeycomb coding style-->
226                        <execution>
227                            <id>check-license</id>
228                            <goals>
229                                <goal>check</goal>
230                            </goals>
231                            <phase>process-sources</phase>
232                            <configuration>
233                                <headerLocation>HONEYCOMB_LICENSE.txt</headerLocation>
234                                <failOnViolation>true</failOnViolation>
235                                <failsOnError>true</failsOnError>
236                                <outputFile>${project.build.directory}/checkstyle-license-result.xml</outputFile>
237                            </configuration>
238                        </execution>
239
240                        <!-- Add logging checks from yangtools -->
241                        <execution>
242                            <id>check-logging</id>
243                            <goals>
244                                <goal>check</goal>
245                            </goals>
246                            <phase>process-sources</phase>
247                            <configuration>
248                                <failOnViolation>true</failOnViolation>
249                                <configLocation>honeycomb-checkstyle-logging.xml</configLocation>
250                                <consoleOutput>true</consoleOutput>
251                                <includeTestSourceDirectory>true</includeTestSourceDirectory>
252                                <sourceDirectory>${project.basedir}</sourceDirectory>
253                                <outputFile>${project.build.directory}/checkstyle-logging-result.xml</outputFile>
254                            </configuration>
255                        </execution>
256                        <execution>
257                            <goals>
258                                <goal>check</goal>
259                            </goals>
260                            <phase>process-sources</phase>
261                        </execution>
262                    </executions>
263                    <dependencies>
264                        <dependency>
265                            <groupId>io.fd.honeycomb.common</groupId>
266                            <artifactId>honeycomb-checkstyle</artifactId>
267                            <!-- Hardcoded version to prevent archetype generated projects to use their own project version -->
268                            <version>1.16.12-SNAPSHOT</version>
269                        </dependency>
270                        <!-- Necessary for logging checks -->
271                        <dependency>
272                            <groupId>org.opendaylight.yangtools</groupId>
273                            <artifactId>checkstyle-logging</artifactId>
274                            <version>${yangtools.version}</version>
275                        </dependency>
276                    </dependencies>
277                </plugin>
278                <!-- Deactivate strict java8 checks -->
279                <!-- TODO HONEYCOMB-156 fix all the javadoc offenders of doclint -->
280                <plugin>
281                    <groupId>org.apache.maven.plugins</groupId>
282                    <artifactId>maven-javadoc-plugin</artifactId>
283                    <version>${maven.javadoc.version}</version>
284                    <configuration>
285                        <additionalparam>-Xdoclint:none</additionalparam>
286                    </configuration>
287                    <executions>
288                        <execution>
289                            <id>attach-javadocs</id>
290                            <goals>
291                                <goal>jar</goal>
292                            </goals>
293                        </execution>
294                    </executions>
295                </plugin>
296                <!-- jacoco test coverage for sonar -->
297                <plugin>
298                    <groupId>org.jacoco</groupId>
299                    <artifactId>jacoco-maven-plugin</artifactId>
300                    <version>${jacoco.version}</version>
301                    <executions>
302                        <execution>
303                            <id>pre-unit-test</id>
304                            <goals>
305                                <goal>prepare-agent</goal>
306                            </goals>
307                            <configuration>
308                                <destFile>${sonar.jacoco.reportPath}</destFile>
309                            </configuration>
310                        </execution>
311                        <execution>
312                            <id>post-unit-test</id>
313                            <goals>
314                                <goal>report</goal>
315                            </goals>
316                            <configuration>
317                                <dataFile>${sonar.jacoco.reportPath}</dataFile>
318                            </configuration>
319                        </execution>
320                    </executions>
321                    <configuration>
322                        <excludes>
323                            <exclude>**/gen/**</exclude>
324                            <exclude>**/generated-sources/**</exclude>
325                            <exclude>**/yang-gen/**</exclude>
326                        </excludes>
327                    </configuration>
328                </plugin>
329                <!-- Enforce maven version -->
330                <plugin>
331                    <groupId>org.apache.maven.plugins</groupId>
332                    <artifactId>maven-enforcer-plugin</artifactId>
333                    <version>${enforcer.version}</version>
334                    <executions>
335                        <execution>
336                            <id>enforce-maven</id>
337                            <configuration>
338                                <rules>
339                                    <requireMavenVersion>
340                                        <version>3.1.1</version>
341                                    </requireMavenVersion>
342                                </rules>
343                            </configuration>
344                            <goals>
345                                <goal>enforce</goal>
346                            </goals>
347                        </execution>
348                    </executions>
349                </plugin>
350                <!-- Compile with google static analysis tool: error_prone -->
351                <plugin>
352                    <groupId>org.apache.maven.plugins</groupId>
353                    <artifactId>maven-compiler-plugin</artifactId>
354                    <version>${maven.compile.plugin.version}</version>
355                    <configuration>
356                        <!-- Use google's error-prone static analysis-->
357                        <compilerId>javac-with-errorprone</compilerId>
358                        <forceJavacCompilerUse>true</forceJavacCompilerUse>
359                        <showWarnings>true</showWarnings>
360                        <source>1.8</source>
361                        <target>1.8</target>
362                    </configuration>
363                    <dependencies>
364                        <dependency>
365                            <groupId>org.codehaus.plexus</groupId>
366                            <artifactId>plexus-compiler-javac-errorprone</artifactId>
367                            <version>2.5</version>
368                        </dependency>
369                        <!-- override plexus-compiler-javac-errorprone's dependency on
370                             Error Prone with the latest version -->
371                        <dependency>
372                            <groupId>com.google.errorprone</groupId>
373                            <artifactId>error_prone_core</artifactId>
374                            <version>2.0.9</version>
375                        </dependency>
376                    </dependencies>
377                </plugin>
378                <plugin>
379                    <groupId>org.apache.felix</groupId>
380                    <artifactId>maven-bundle-plugin</artifactId>
381                    <version>${maven.bundle.version}</version>
382                    <extensions>true</extensions>
383                </plugin>
384                <!-- Source jar -->
385                <plugin>
386                    <groupId>org.apache.maven.plugins</groupId>
387                    <artifactId>maven-source-plugin</artifactId>
388                    <executions>
389                        <execution>
390                            <id>attach-sources</id>
391                            <goals>
392                                <goal>jar</goal>
393                            </goals>
394                        </execution>
395                    </executions>
396                </plugin>
397                <!-- Site (from https://github.com/asciidoctor/asciidoctor-maven-examples/blob/master/asciidoc-maven-site-example/pom.xml) -->
398                <!-- + https://github.com/asciidoctor/asciidoctor-maven-plugin -->
399                <plugin>
400                    <groupId>org.apache.maven.plugins</groupId>
401                    <artifactId>maven-site-plugin</artifactId>
402                    <version>${maven.site.version}</version>
403                    <configuration>
404                        <generateReports>true</generateReports>
405                        <generateSitemap>true</generateSitemap>
406                        <relativizeDecorationLinks>false</relativizeDecorationLinks>
407                        <locales>en</locales>
408                        <inputEncoding>UTF-8</inputEncoding>
409                        <outputEncoding>UTF-8</outputEncoding>
410                        <siteDirectory>${project.basedir}</siteDirectory>
411                        <relativizeDecorationLinks>false</relativizeDecorationLinks>
412                        <asciidoc>
413                            <requires>
414                                <require>asciidoctor-diagram</require>
415                            </requires>
416                            <!-- optional site-wide AsciiDoc attributes -->
417                            <attributes>
418                                <source-highlighter>coderay</source-highlighter>
419                                <coderay-css>style</coderay-css>
420                                <imagesdir>${project.build.directory}/site/images</imagesdir>
421                                <toc>left</toc>
422                                <toclevels>2</toclevels>
423                                <icons>font</icons>
424                                <sectanchors>true</sectanchors>
425                                <idprefix/>
426                                <idseparator>-</idseparator>
427                            </attributes>
428                        </asciidoc>
429                        <!-- Exclude partial docs that are included elsewhere -->
430                        <moduleExcludes>
431                            <asciidoc>**/_*.adoc</asciidoc>
432                        </moduleExcludes>
433                    </configuration>
434                    <dependencies>
435                        <dependency>
436                            <groupId>org.asciidoctor</groupId>
437                            <artifactId>asciidoctor-maven-plugin</artifactId>
438                            <version>${asciidoctor.maven.plugin.version}</version>
439                        </dependency>
440                        <dependency>
441                            <groupId>org.asciidoctor</groupId>
442                            <artifactId>asciidoctorj-diagram</artifactId>
443                            <version>${asciidoctorj.diagram.version}</version>
444                        </dependency>
445                    </dependencies>
446                </plugin>
447                <plugin>
448                    <groupId>org.codehaus.gmaven</groupId>
449                    <artifactId>groovy-maven-plugin</artifactId>
450                    <version>${maven.groovy.version}</version>
451                    <executions>
452                        <!-- Generate Readme.adoc if not present -->
453                        <execution>
454                            <id>generate-adoc</id>
455                            <phase>generate-resources</phase>
456                            <goals>
457                                <goal>execute</goal>
458                            </goals>
459                            <configuration>
460                                <!-- Generate module adoc documentation -->
461                                <source>
462                                    io.fd.honeycomb.common.scripts.ReadmeGenerator.checkReadme(project, properties, log)
463                                </source>
464                            </configuration>
465                        </execution>
466                        <!-- Fix generated html -->
467                        <execution>
468                            <id>fix-generated-site</id>
469                            <phase>site</phase>
470                            <goals>
471                                <goal>execute</goal>
472                            </goals>
473                            <configuration>
474                                <!-- Site generates wrong link to Readme.html, trying to point to Readme.html at root -->
475                                <source>
476                                    io.fd.honeycomb.common.scripts.ReadmeGenerator.fixSite(project, properties, log)
477                                </source>
478                            </configuration>
479                        </execution>
480                    </executions>
481                    <dependencies>
482                        <dependency>
483                            <groupId>io.fd.honeycomb.common</groupId>
484                            <artifactId>common-scripts</artifactId>
485                            <version>1.16.12-SNAPSHOT</version>
486                        </dependency>
487                    </dependencies>
488                </plugin>
489            </plugins>
490        </pluginManagement>
491        <plugins>
492            <plugin>
493                <artifactId>maven-enforcer-plugin</artifactId>
494            </plugin>
495            <plugin>
496                <artifactId>maven-source-plugin</artifactId>
497            </plugin>
498            <plugin>
499                <artifactId>maven-javadoc-plugin</artifactId>
500            </plugin>
501            <plugin>
502                <artifactId>maven-checkstyle-plugin</artifactId>
503            </plugin>
504            <plugin>
505                <artifactId>maven-dependency-plugin</artifactId>
506            </plugin>
507            <plugin>
508                <artifactId>maven-compiler-plugin</artifactId>
509            </plugin>
510            <plugin>
511                <groupId>org.jacoco</groupId>
512                <artifactId>jacoco-maven-plugin</artifactId>
513            </plugin>
514            <plugin>
515                <groupId>org.apache.felix</groupId>
516                <artifactId>maven-bundle-plugin</artifactId>
517            </plugin>
518            <plugin>
519                <groupId>org.codehaus.gmaven</groupId>
520                <artifactId>groovy-maven-plugin</artifactId>
521            </plugin>
522        </plugins>
523
524        <!-- To support site push-->
525        <extensions>
526            <extension>
527                <groupId>org.apache.maven.wagon</groupId>
528                <artifactId>wagon-webdav-jackrabbit</artifactId>
529                <version>2.9</version>
530            </extension>
531        </extensions>
532    </build>
533
534    <reporting>
535        <plugins>
536            <plugin>
537                <groupId>org.apache.maven.plugins</groupId>
538                <artifactId>maven-project-info-reports-plugin</artifactId>
539                <version>${project.info.report.version}</version>
540                <reportSets>
541                    <reportSet>
542                        <reports>
543                            <report>index</report>
544                            <report>summary</report>
545                            <report>modules</report>
546                            <report>cim</report>
547                            <report>dependencies</report>
548                            <report>distribution-management</report>
549                            <report>mailing-list</report>
550                            <report>issue-tracking</report>
551                            <report>license</report>
552                            <report>scm</report>
553                        </reports>
554                    </reportSet>
555                </reportSets>
556            </plugin>
557            <plugin>
558                <groupId>org.apache.maven.plugins</groupId>
559                <artifactId>maven-javadoc-plugin</artifactId>
560                <version>${maven.javadoc.version}</version>
561                <reportSets>
562                    <reportSet>
563                        <id>default</id>
564                        <reports>
565                            <report>javadoc-no-fork</report>
566                        </reports>
567                    </reportSet>
568                </reportSets>
569                <configuration>
570                    <additionalparam>-Xdoclint:none</additionalparam>
571                </configuration>
572            </plugin>
573            <plugin>
574                <groupId>org.apache.maven.plugins</groupId>
575                <artifactId>maven-resources-plugin</artifactId>
576                <version>${maven.resources.version}</version>
577            </plugin>
578        </plugins>
579    </reporting>
580
581    <distributionManagement>
582        <repository>
583            <id>fdio-release</id>
584            <url>${nexusproxy}/repositories/fd.io.release/</url>
585        </repository>
586        <snapshotRepository>
587            <id>fdio-snapshot</id>
588            <url>${nexusproxy}/repositories/fd.io.snapshot/</url>
589        </snapshotRepository>
590        <site>
591            <id>fdio-site</id>
592            <url>dav:${docs.base.url}/${docs.hc.folder}/${project.version}</url>
593        </site>
594    </distributionManagement>
595
596    <repositories>
597        <!-- Using only ODL stable releases -->
598        <repository>
599            <releases>
600                <enabled>true</enabled>
601                <updatePolicy>never</updatePolicy>
602            </releases>
603            <snapshots>
604                <enabled>false</enabled>
605            </snapshots>
606            <id>opendaylight-mirror</id>
607            <name>opendaylight-mirror</name>
608            <url>${odl.nexusproxy}/repositories/public/</url>
609        </repository>
610    </repositories>
611</project>
612