Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 64 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
<maven-enforcer-plugin.version>3.1.0</maven-enforcer-plugin.version>
<maven-flatten-plugin.version>1.3.0</maven-flatten-plugin.version>
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
<maven-install-plugin.version>3.0.1</maven-install-plugin.version>
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
Expand All @@ -55,6 +56,7 @@
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
<xml-maven-plugin.version>1.0.2</xml-maven-plugin.version>

<checkstyle.version>9.2.1</checkstyle.version>

Expand Down Expand Up @@ -347,6 +349,67 @@
</archive>
</configuration>
</plugin>

<!--
Build a flatten POM (consumer)
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>${maven-flatten-plugin.version}</version>
<configuration>
<flattenMode>ossrh</flattenMode>
<keepCommentsInPom>true</keepCommentsInPom>
<updatePomFile>true</updatePomFile>
<flattenedPomFilename>flattened-pom.xml</flattenedPomFilename>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>prepare-package</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
</executions>
</plugin>

<!--
Remove shaded dependencies from the flatten POM
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<version>${xml-maven-plugin.version}</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>transform</goal>
</goals>
</execution>
</executions>
<configuration>
<transformationSets>
<transformationSet>
<dir>${project.build.directory}</dir>
<outputDir>${project.build.directory}</outputDir>
<includes>
<include>flattened-pom.xml</include>
</includes>
<stylesheet>src/xsl/flatten-pom.xslt</stylesheet>
</transformationSet>
</transformationSets>
</configuration>
</plugin>

<!--
Shade some dependencies inside the main jar.

Note: don't forget to update the XSLT used to build the flatten POM when adding/removing
shaded dependencies.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand All @@ -360,7 +423,7 @@
</executions>
<configuration>
<shadedArtifactAttached>false</shadedArtifactAttached>
<createDependencyReducedPom>true</createDependencyReducedPom>
<createDependencyReducedPom>false</createDependencyReducedPom>
<createSourcesJar>true</createSourcesJar>
<shadeSourcesContent>true</shadeSourcesContent>
<minimizeJar>true</minimizeJar>
Expand Down Expand Up @@ -389,7 +452,6 @@
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${maven-bundle-plugin.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<id>bundle-manifest</id>
Expand Down Expand Up @@ -452,19 +514,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven-clean-plugin.version}</version>
<configuration>
<filesets>
<!-- Remove dependency reduced pom file created by maven-shade-plugin
in the basedir of the project
-->
<fileset>
<directory>.</directory>
<includes>
<include>dependency-reduced-pom.xml</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>

<plugin>
Expand Down
20 changes: 20 additions & 0 deletions src/xsl/flatten-pom.xslt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" cdata-section-elements="cdata-other-elements"/>

<!-- Remove extra blank lines added by xsl transformation since Java 9.
See https://bugs.openjdk.org/browse/JDK-8262285
-->
<xsl:strip-space elements="*"/>

<!-- Copy all nodes asis
-->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>

<!-- Ignore shaded dependencies
-->
<xsl:template match="/project/dependencies/dependency[groupId='com.lmax' and artifactId='disruptor']" />
</xsl:stylesheet>