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

View File

@ -18,4 +18,4 @@ jobs:
with:
java-version: ${{ matrix.java }}
- run: java -version && mvn --version
- run: mvn --no-transfer-progress package javadoc:jar source:jar-no-fork
- run: mvn --activate-profiles dist --no-transfer-progress package

View File

@ -20,6 +20,7 @@
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
<maven.javadoc.skip>true</maven.javadoc.skip>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<maven.build.timestamp.format>yyyyMMdd</maven.build.timestamp.format>

View File

@ -30,6 +30,7 @@
<properties>
<module.author>SpigotMC</module.author>
<maven.deploy.skip>true</maven.deploy.skip>
<maven.javadoc.skip>true</maven.javadoc.skip>
</properties>
<dependencies>

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>

View File

@ -20,6 +20,7 @@
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
<maven.javadoc.skip>true</maven.javadoc.skip>
</properties>
<dependencies>