#837 - POM cleanups.

Removed duplicate declaration of the deploy plugin.

Switched to the prepare-package phase for the documentation generation as the declaration of the Maven Build Helper Plugin caused the unpacking of the dependencies to be delayed to after the asciidoctor execution which then renders the CSS and JavaScript files missing.

Extracted the JavaDoc generation settings into the plugin management section so that both the CI build as well as the one creating the JavaDoc for the site deployment use the same setup. Removed the JavaDoc declaration from the default build and activate it in the testing build.

Removed inclusion of Spring Data static resources as they're superseded by the docs resources.
This commit is contained in:
Oliver Drotbohm
2019-03-03 16:49:40 +01:00
parent 8ddca10ed3
commit 0cbe2d8544
2 changed files with 54 additions and 105 deletions

View File

@@ -8,4 +8,4 @@ rm -rf $HOME/.m2/repository/org/springframework/hateoas 2> /dev/null || :
cd spring-hateoas-github
./mvnw clean dependency:list test -P${PROFILE} -Dsort
./mvnw clean dependency:list test -Pci -Dsort

157
pom.xml
View File

@@ -69,6 +69,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<source.level>1.8</source.level>
<docs.resources.version>0.1.0.RELEASE</docs.resources.version>
<evo.version>1.2.2</evo.version>
<logback.version>1.2.3</logback.version>
<jacoco>0.7.9</jacoco>
@@ -124,9 +125,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>create-javadoc-jar</id>
<goals>
<goal>jar</goal>
</goals>
@@ -182,18 +183,9 @@
<shared.resources>${project.build.directory}/shared-resources</shared.resources>
<maven.install.skip>true</maven.install.skip>
<skipTests>true</skipTests>
<project.root>${basedir}</project.root>
<docs.resources.version>0.1.0.RELEASE</docs.resources.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.data.build</groupId>
<artifactId>spring-data-build-resources</artifactId>
<version>2.0.0.RELEASE</version>
<scope>provided</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>io.spring.docresources</groupId>
<artifactId>spring-doc-resources</artifactId>
@@ -215,62 +207,32 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-shared-resources</id>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<phase>generate-resources</phase>
</execution>
<execution>
<id>unpack-doc-resources</id>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<phase>generate-resources</phase>
<phase>prepare-package</phase>
<configuration>
<includeGroupIds>io.spring.docresources</includeGroupIds>
<includeArtifactIds>spring-doc-resources</includeArtifactIds>
<includeTypes>zip</includeTypes>
<excludeTransitive>true</excludeTransitive>
<outputDirectory>${project.build.directory}/refdocs/</outputDirectory>
</configuration>
</execution>
</executions>
<configuration>
<includeGroupIds>org.springframework.data</includeGroupIds>
<includeArtifactIds>spring-data-build-resources</includeArtifactIds>
<includeTypes>zip</includeTypes>
<excludeTransitive>true</excludeTransitive>
<outputDirectory>${shared.resources}</outputDirectory>
</configuration>
</plugin>
<!--
Configures JavaDoc generation.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>aggregate-javadoc</id>
<goals>
<goal>javadoc</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-asciidoc-resources</id>
<phase>generate-resources</phase>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
@@ -307,7 +269,7 @@
<execution>
<id>html</id>
<phase>generate-resources</phase>
<phase>prepare-package</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
@@ -335,7 +297,7 @@
<execution>
<id>pdf</id>
<phase>generate-resources</phase>
<phase>prepare-package</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
@@ -367,6 +329,24 @@
</plugin>
<!--
Configures JavaDoc generation.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>javadoc</id>
<phase>prepare-package</phase>
<goals>
<goal>javadoc</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
@@ -374,10 +354,13 @@
<execution>
<id>copy-documentation-resources</id>
<phase>generate-resources</phase>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<copy todir="${project.root}/target/site/reference/html/images">
<copy todir="${basedir}/target/site/reference/html/images">
<fileset dir="${basedir}/src/main/asciidoc" erroronmissingdir="false">
<include name="**/*.png" />
<include name="**/*.gif" />
@@ -387,17 +370,14 @@
</copy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>rename-reference-docs</id>
<phase>process-resources</phase>
<phase>prepare-package</phase>
<configuration>
<target>
<copy file="${project.build.directory}/generated-docs/index.pdf" tofile="${project.root}/target/site/reference/pdf/${project.artifactId}-reference.pdf" failonerror="false" />
<copy file="${project.build.directory}/generated-docs/index.pdf" tofile="${basedir}/target/site/reference/pdf/${project.artifactId}-reference.pdf" failonerror="false" />
</target>
</configuration>
<goals>
@@ -434,6 +414,7 @@
<goals>
<goal>attach-artifact</goal>
</goals>
<phase>package</phase>
<configuration>
<artifacts>
<artifact>
@@ -446,28 +427,6 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>static</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptors>
<descriptor>${shared.resources}/assemblies/static-resources.xml</descriptor>
</descriptors>
<finalName>static-resources</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
@@ -700,6 +659,27 @@
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<configuration>
<breakiterator>true</breakiterator>
<header>${project.name}</header>
<source>${source.level}</source>
<quiet>true</quiet>
<additionalparam>-Xdoclint:none</additionalparam>
<links>
<link>http://static.springframework.org/spring/docs/5.1.x/javadoc-api</link>
<link>http://docs.oracle.com/javase/8/docs/api</link>
</links>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
@@ -760,31 +740,6 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<configuration>
<breakiterator>true</breakiterator>
<header>${project.name}</header>
<source>${source.level}</source>
<quiet>true</quiet>
<additionalparam>-Xdoclint:none</additionalparam>
<links>
<link>http://static.springframework.org/spring/docs/4.1.x/javadoc-api</link>
<link>http://docs.oracle.com/javase/6/docs/api</link>
</links>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
@@ -834,12 +789,6 @@
<version>2.8.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</build>