Add dist Maven profile to generate source and Javadoc jars

This commit is contained in:
md_5
2020-02-04 14:59:52 +11:00
parent 9e8ab747e4
commit 17d5dd3f94
5 changed files with 76 additions and 1 deletions

72
pom.xml
View File

@@ -165,4 +165,76 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>dist</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.18.10.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>delombok</goal>
</goals>
</execution>
</executions>
<configuration>
<addOutputDirectory>false</addOutputDirectory>
<outputDirectory>${project.build.directory}/delombok</outputDirectory>
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<executions>
<!-- Execute Javadoc once normally to catch any warnings -->
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
<!-- Then execute it again to generate properly with delombok -->
<execution>
<id>delombok</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<!-- lombok does not add @return or @param which causes warnings, so ignore -->
<doclint>none</doclint>
<sourcepath>${project.build.directory}/delombok</sourcepath>
</configuration>
</execution>
</executions>
<configuration>
<quiet>true</quiet>
<failOnWarnings>true</failOnWarnings>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>