git-commit-id-plugin cannot fail build for new projects w.o. .git/
[odlparent.git] / odlparent-lite / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- vi: set et smarttab sw=2 tabstop=2: -->
3 <!--
4  Copyright (c) 2015 The Linux Foundation and others.  All rights reserved.
5
6  This program and the accompanying materials are made available under the
7  terms of the Eclipse Public License v1.0 which accompanies this distribution,
8  and is available at http://www.eclipse.org/legal/epl-v10.html
9 -->
10 <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">
11   <modelVersion>4.0.0</modelVersion>
12
13   <!--
14       Note: This parent is not meant to be used by code artifacts. Please use
15             odlparent instead.
16   -->
17
18   <groupId>org.opendaylight.odlparent</groupId>
19   <artifactId>odlparent-lite</artifactId>
20   <version>1.8.0-SNAPSHOT</version>
21   <packaging>pom</packaging>
22   <name>ODL :: odlparent :: ${project.artifactId}</name>
23
24   <!-- Sufficient Metadata for Maven Central Repository deployment
25        These are default, some of which project inheriting from this POM may override (but don't have to, typically)
26        see http://central.sonatype.org/pages/requirements.html
27    -->
28   <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
29   <description>OpenDaylight is leading the transformation to Open Software Defined Networking (SDN). For more information, please see https://www.opendaylight.org</description>
30
31   <licenses>
32     <license>
33       <name>Eclipse Public License v1.0</name>
34       <url>https://www.eclipse.org/legal/epl-v10.html</url>
35     </license>
36   </licenses>
37
38   <organization>
39     <name>OpenDaylight</name>
40     <url>https://www.opendaylight.org</url>
41   </organization>
42
43   <issueManagement>
44     <system>Bugzilla</system>
45     <url>https://bugs.opendaylight.org/</url>
46   </issueManagement>
47
48   <ciManagement>
49     <system>Jenkins</system>
50     <url>https://jenkins.opendaylight.org/releng/</url>
51   </ciManagement>
52
53   <scm>
54     <url>https://git.opendaylight.org/gerrit/</url>
55   </scm>
56
57   <developers>
58     <developer>
59       <id>*</id>
60       <name>Please consult the PROJECT_INFO.yaml, README* and/or CONTRIBUTORS which should be included with this JAR</name>
61       <url>https://www.opendaylight.org</url>
62       <email>helpdesk@opendaylight.org</email>
63     </developer>
64   </developers>
65
66   <prerequisites>
67     <!-- This is only used to prevent building with Maven < 3 and to appease
68          maven-dependency-plugin; our real Maven requirement is enforced by
69          the enforcer plugin. -->
70     <maven>3.0.5</maven>
71   </prerequisites>
72
73   <properties>
74     <nexusproxy>https://nexus.opendaylight.org/content</nexusproxy>
75
76     <!-- Variables required for Maven Site generation -->
77     <nexus.site.url>file:${user.dir}/target/staged-site</nexus.site.url>
78     <odl.site.url>https://nexus.opendaylight.org/content/sites/site/</odl.site.url>
79     <stream>latest</stream><!-- CI should pass in -Dstream={stream} -->
80
81     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
82     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
83   </properties>
84
85   <build>
86     <pluginManagement>
87       <plugins>
88         <plugin>
89           <artifactId>maven-clean-plugin</artifactId>
90           <version>3.0.0</version>
91         </plugin>
92         <plugin>
93           <artifactId>maven-deploy-plugin</artifactId>
94           <version>2.8.2</version>
95         </plugin>
96         <plugin>
97           <artifactId>maven-install-plugin</artifactId>
98           <version>2.5.2</version>
99         </plugin>
100         <plugin>
101           <artifactId>maven-javadoc-plugin</artifactId>
102           <version>2.10.4</version>
103           <configuration>
104             <!-- Keep things quiet except for warnings/errors -->
105             <quiet>true</quiet>
106             <tags>
107               <!-- support for HelpMojo generated by the maven-plugin-plugin -->
108               <tag>
109                 <name>goal</name>
110                 <placement>t</placement>
111                 <head>Goal:</head>
112               </tag>
113               <tag>
114                 <name>requiresProject</name>
115                 <placement>t</placement>
116                 <head>Requires project:</head>
117               </tag>
118               <tag>
119                 <name>threadSafe</name>
120                 <placement>t</placement>
121                 <head>Threadsafe</head>
122               </tag>
123               <tag>
124                 <name>phase</name>
125                 <placement>t</placement>
126                 <head>Phase:</head>
127               </tag>
128               <!-- end HelpMojo support -->
129             </tags>
130           </configuration>
131           <executions>
132             <execution>
133               <id>attach-javadocs</id>
134               <goals>
135                 <goal>jar</goal>
136               </goals>
137             </execution>
138           </executions>
139         </plugin>
140         <plugin>
141           <artifactId>maven-project-info-reports-plugin</artifactId>
142           <version>2.9</version>
143         </plugin>
144         <plugin>
145           <artifactId>maven-release-plugin</artifactId>
146           <version>2.5.3</version>
147         </plugin>
148         <plugin>
149           <artifactId>maven-site-plugin</artifactId>
150           <version>3.5.1</version>
151           <configuration>
152             <asciidoc>
153               <attributes>
154                 <imagesdir>./images</imagesdir>
155                 <imagesoutdir>${project.build.directory}/site/images</imagesoutdir>
156                 <icons>font</icons>
157                 <source-highlighter>coderay</source-highlighter>
158                 <coderay-css>style</coderay-css>
159               </attributes>
160               <requires>
161                 <require>asciidoctor-diagram</require>
162               </requires>
163             </asciidoc>
164           </configuration>
165           <dependencies>
166             <dependency>
167               <!-- Downgrade Velocity; the Asciidoctor templates don't work with Velocity 1.7 -->
168               <!-- See https://maven.apache.org/plugins/maven-site-plugin/migrate.html -->
169               <groupId>org.apache.velocity</groupId>
170               <artifactId>velocity</artifactId>
171               <version>1.5</version>
172             </dependency>
173             <dependency>
174               <groupId>org.apache.maven.doxia</groupId>
175               <artifactId>doxia-core</artifactId>
176               <version>1.7</version>
177             </dependency>
178             <dependency>
179               <groupId>org.asciidoctor</groupId>
180               <artifactId>asciidoctor-maven-plugin</artifactId>
181               <version>1.5.3</version>
182             </dependency>
183             <dependency>
184               <groupId>org.asciidoctor</groupId>
185               <artifactId>asciidoctorj-diagram</artifactId>
186               <version>1.3.1</version>
187             </dependency>
188           </dependencies>
189         </plugin>
190         <plugin>
191           <groupId>org.codehaus.mojo</groupId>
192           <artifactId>jdepend-maven-plugin</artifactId>
193           <version>2.0</version>
194           <executions>
195             <execution>
196               <phase>site</phase>
197               <goals>
198                 <goal>generate-no-fork</goal>
199               </goals>
200             </execution>
201           </executions>
202         </plugin>
203         <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
204         <plugin>
205           <groupId>org.eclipse.m2e</groupId>
206           <artifactId>lifecycle-mapping</artifactId>
207           <version>1.0.0</version>
208           <configuration>
209             <lifecycleMappingMetadata>
210               <pluginExecutions>
211                 <pluginExecution>
212                   <pluginExecutionFilter>
213                     <groupId>org.apache.maven.plugins</groupId>
214                     <artifactId>maven-dependency-plugin</artifactId>
215                     <versionRange>[2.10,)</versionRange>
216                     <goals>
217                       <goal>unpack</goal>
218                     </goals>
219                   </pluginExecutionFilter>
220                   <action>
221                     <ignore></ignore>
222                   </action>
223                 </pluginExecution>
224                 <pluginExecution>
225                   <pluginExecutionFilter>
226                     <groupId>org.apache.maven.plugins</groupId>
227                     <artifactId>maven-enforcer-plugin</artifactId>
228                     <versionRange>[1.0.0,)</versionRange>
229                     <goals>
230                       <goal>enforce</goal>
231                     </goals>
232                   </pluginExecutionFilter>
233                   <action>
234                     <ignore/>
235                   </action>
236                 </pluginExecution>
237               </pluginExecutions>
238             </lifecycleMappingMetadata>
239           </configuration>
240         </plugin>
241       </plugins>
242     </pluginManagement>
243
244     <plugins>
245       <plugin>
246         <artifactId>maven-enforcer-plugin</artifactId>
247         <version>1.4.1</version>
248         <executions>
249           <execution>
250             <id>enforce-maven</id>
251             <configuration>
252               <rules>
253                 <requireJavaVersion>
254                   <version>1.8.0</version>
255                 </requireJavaVersion>
256                 <requireMavenVersion>
257                   <version>[3.3.9,)</version>
258                 </requireMavenVersion>
259               </rules>
260             </configuration>
261             <goals>
262               <goal>enforce</goal>
263             </goals>
264           </execution>
265         </executions>
266       </plugin>
267       <plugin>
268         <groupId>pl.project13.maven</groupId>
269         <artifactId>git-commit-id-plugin</artifactId>
270         <version>2.2.1</version>
271         <executions>
272           <execution>
273             <id>get-git-infos</id>
274             <goals>
275               <goal>revision</goal>
276             </goals>
277           </execution>
278         </executions>
279         <configuration>
280           <failOnNoGitDirectory>false</failOnNoGitDirectory>
281           <generateGitPropertiesFile>true</generateGitPropertiesFile>
282           <generateGitPropertiesFilename>${project.build.outputDirectory}/META-INF/git.properties</generateGitPropertiesFilename>
283           <gitDescribe>
284             <skip>false</skip>
285             <always>true</always>
286             <tags>true</tags>
287           </gitDescribe>
288         </configuration>
289       </plugin>
290     </plugins>
291   </build>
292
293   <profiles>
294     <profile>
295       <id>ide</id>
296       <activation>
297         <property>
298           <name>m2e.version</name>
299         </property>
300       </activation>
301       <build>
302         <!-- Put the IDE's build output in a folder other than target, so that IDE builds don't interact with Maven builds -->
303         <directory>target-ide</directory>
304       </build>
305     </profile>
306     <profile>
307         <!-- http://blog2.vorburger.ch/2016/06/improve-maven-build-speed-with-q.html
308              q = http://memory-alpha.wikia.com/wiki/Q ;)
309
310              The Quick profile is used during incremental local development, when you want to "just get that JAR built",
311              which is very handy e.g. for fast hot reloading cycles in Karaf with bundle watch.  It (intentionally!) skips
312              tests, quality checks etc. which are great and useful to run before finally submitting changes to Gerrit, and
313              which all must run on Gerrit, but which are overhead during ongoing fast iterative local development.
314
315              Note that the idea here is that your IDE will already have run quality checks such as e.g. Checkstyle
316              while you typed the code anyway.  Similarly, if you wrote a test, you'll probably already have compiled and run it
317              from your IDE, so when you want the OSGi bundle JAR for Karaf, ASAP, you typically don't want all that to run again.
318           -->
319         <id>q</id>
320         <properties>
321             <skipTests>true</skipTests>
322             <!-- But NOT <maven.test.skip>true, as that's for compiling, not running, tests;
323                  and that's usually quick.  Skipping test compilation with -Pq with maven.test.skip would be
324                  particularly confusing when used in a project with maven-jar-plugin <goal>test-jar, so don't.)  -->
325             <skipIT>true</skipIT>
326             <skipITs>true</skipITs>
327             <skip.karaf.featureTest>true</skip.karaf.featureTest>
328             <jacoco.skip>true</jacoco.skip>
329             <maven.javadoc.skip>true</maven.javadoc.skip>
330             <maven.source.skip>true</maven.source.skip>
331             <checkstyle.skip>true</checkstyle.skip>
332             <findbugs.skip>true</findbugs.skip>
333             <pmd.skip>true</pmd.skip>
334             <cpd.skip>true</cpd.skip>
335             <maven.site.skip>true</maven.site.skip>
336             <invoker.skip>true</invoker.skip>
337             <enforcer.skip>true</enforcer.skip>
338             <mdsal.skip.verbose>true</mdsal.skip.verbose> <!-- Bug 6236 -->
339         </properties>
340     </profile>
341     <profile>
342       <!-- http://blog2.vorburger.ch/2016/06/maven-install-into-additional.html
343            mvn [-o -Pq] install -DaddInstallRepositoryPath=.../karaf/system is used in development to directly
344            install artifacts such as bundles and KARs not just into the global shared ~/.m2/repository
345            but also into the isolated Maven repo of a Karaf distribution.
346        -->
347       <activation>
348         <property>
349           <name>addInstallRepositoryPath</name>
350         </property>
351       </activation>
352       <build>
353         <plugins>
354           <plugin>
355             <artifactId>maven-install-plugin</artifactId>
356             <executions>
357               <execution>
358                 <id>additional-install</id>
359                 <phase>install</phase>
360                 <goals>
361                   <goal>install-file</goal>
362                 </goals>
363                 <configuration>
364                   <file>${project.build.directory}/${project.build.finalName}.jar</file>
365                   <localRepositoryPath>${addInstallRepositoryPath}</localRepositoryPath>
366                 </configuration>
367               </execution>
368             </executions>
369           </plugin>
370         </plugins>
371       </build>
372     </profile>
373     <profile>
374       <!--
375           This profile is to ensure we only build javadocs reports
376           when we plan to deploy Maven site for our project.
377
378           It activates by checking for the existance of deploy-site.xml in the
379           user's current working directory. (Intent is that this is run from
380           the Project root directory)
381       -->
382       <id>maven-site</id>
383       <activation>
384         <file>
385           <exists>${user.dir}/deploy-site.xml</exists>
386         </file>
387       </activation>
388
389       <build>
390         <plugins>
391           <plugin>
392             <artifactId>maven-site-plugin</artifactId>
393
394             <executions>
395               <execution>
396                 <id>generate-site</id>
397                 <phase>install</phase>
398                 <goals>
399                   <goal>site</goal>
400                   <goal>attach-descriptor</goal>
401                 </goals>
402               </execution>
403             </executions>
404           </plugin>
405         </plugins>
406       </build>
407
408       <reporting>
409         <plugins>
410           <plugin>
411             <artifactId>maven-project-info-reports-plugin</artifactId>
412             <configuration>
413               <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
414             </configuration>
415             <reportSets>
416               <reportSet>
417                 <reports>
418                   <report>index</report>
419                 </reports>
420               </reportSet>
421             </reportSets>
422           </plugin>
423           <plugin>
424             <artifactId>maven-javadoc-plugin</artifactId>
425             <reportSets>
426               <reportSet>
427                 <reports>
428                   <report>javadoc-no-fork</report>
429                   <report>test-javadoc-no-fork</report>
430                 </reports>
431               </reportSet>
432             </reportSets>
433           </plugin>
434         </plugins>
435       </reporting>
436     </profile>
437   </profiles>
438
439   <distributionManagement>
440     <repository>
441       <id>opendaylight-release</id>
442       <url>${nexusproxy}/repositories/opendaylight.release/</url>
443     </repository>
444     <snapshotRepository>
445       <id>opendaylight-snapshot</id>
446       <url>${nexusproxy}/repositories/opendaylight.snapshot/</url>
447     </snapshotRepository>
448     <site>
449       <id>opendaylight-site</id>
450       <url>${nexus.site.url}/${project.artifactId}/</url>
451     </site>
452   </distributionManagement>
453 </project>