pom.xml: Only use javadoc, source and deploy plugins in release profile

Avoid performing the costly process of building the javadoc and source
jars when not performing a release.

Ref: http://central.sonatype.org/pages/apache-maven.html#using-a-profile
This commit is contained in:
Paul Campbell 2015-12-29 09:08:34 +00:00
parent 670e1a4d85
commit ca82b4de1b

77
pom.xml
View file

@ -52,7 +52,7 @@
<profiles> <profiles>
<profile> <profile>
<id>release-sign-artifacts</id> <id>release</id>
<activation> <activation>
<property> <property>
<name>performRelease</name> <name>performRelease</name>
@ -77,10 +77,46 @@
</goals> </goals>
</execution> </execution>
</executions> </executions>
</plugin> </plugin><!-- maven-gpg-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin><!-- maven-source-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>verify</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin><!-- maven-javadoc-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin><!-- maven deploy-plugin -->
</plugins> </plugins>
</build> </build>
</profile><!-- release-sign-artifacts --> </profile><!-- release -->
</profiles> </profiles>
<build> <build>
@ -262,41 +298,6 @@
</rules> </rules>
</configuration> </configuration>
</plugin><!-- jacoco-maven-plugin --> </plugin><!-- jacoco-maven-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin><!-- maven-source-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>verify</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin><!-- maven-javadoc-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin><!-- maven deploy-plugin -->
</plugins> </plugins>
</build> </build>