forked from Qortal/qortal
pom.xml modifications for reproducible builds
Seems to produce fat JARs with the same MD5 after repeated runs of: mvn clean package Needs testing on other platforms, hence this commit. Also trimmed some unneeded included JAR libraries from pom.xml, e.g. netty, async-http-client, and the *.js.map files from Swagger-UI, which seems to reduce output JAR size from about 51MB to about 44MB.
This commit is contained in:
parent
d2d2956c8a
commit
2af370d55d
92
pom.xml
92
pom.xml
@ -72,6 +72,37 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>pl.project13.maven</groupId>
|
||||||
|
<artifactId>git-commit-id-plugin</artifactId>
|
||||||
|
<version>4.0.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>get-the-git-infos</id>
|
||||||
|
<goals>
|
||||||
|
<goal>revision</goal>
|
||||||
|
</goals>
|
||||||
|
<phase>initialize</phase>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<generateGitPropertiesFile>true</generateGitPropertiesFile>
|
||||||
|
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
|
||||||
|
<includeOnlyProperties>
|
||||||
|
<includeOnlyProperty>^git.commit.time$</includeOnlyProperty>
|
||||||
|
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
|
||||||
|
</includeOnlyProperties>
|
||||||
|
<dateFormat>yyyyMMddHHmmss</dateFormat>
|
||||||
|
<dateFormatTimeZone>UTC</dateFormatTimeZone>
|
||||||
|
<gitDescribe>
|
||||||
|
<dirty>-devel</dirty>
|
||||||
|
</gitDescribe>
|
||||||
|
<commitIdGenerationMode>full</commitIdGenerationMode>
|
||||||
|
<injectAllReactorProjects>true</injectAllReactorProjects>
|
||||||
|
<offline>true</offline>
|
||||||
|
<skipPoms>false</skipPoms>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<!-- inject correct url to swagger json file into swagger-ui -->
|
<!-- inject correct url to swagger json file into swagger-ui -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>com.google.code.maven-replacer-plugin</groupId>
|
<groupId>com.google.code.maven-replacer-plugin</groupId>
|
||||||
@ -79,12 +110,12 @@
|
|||||||
<version>1.5.3</version>
|
<version>1.5.3</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
<id>replace-swagger-ui</id>
|
||||||
<phase>generate-resources</phase>
|
<phase>generate-resources</phase>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>replace</goal>
|
<goal>replace</goal>
|
||||||
</goals>
|
</goals>
|
||||||
</execution>
|
<inherited>false</inherited>
|
||||||
</executions>
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<file>${project.build.directory}/swagger-ui.unpacked/META-INF/resources/webjars/swagger-ui/${swagger-ui.version}/index.html</file>
|
<file>${project.build.directory}/swagger-ui.unpacked/META-INF/resources/webjars/swagger-ui/${swagger-ui.version}/index.html</file>
|
||||||
<replacements>
|
<replacements>
|
||||||
@ -107,6 +138,27 @@
|
|||||||
</replacement>
|
</replacement>
|
||||||
</replacements>
|
</replacements>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>replace-git-resources</id>
|
||||||
|
<phase>generate-resources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>replace</goal>
|
||||||
|
</goals>
|
||||||
|
<inherited>false</inherited>
|
||||||
|
<configuration>
|
||||||
|
<file>${project.build.outputDirectory}/git.properties</file>
|
||||||
|
<regex>true</regex>
|
||||||
|
<regexFlags><regexFlag>MULTILINE</regexFlag></regexFlags>
|
||||||
|
<replacements>
|
||||||
|
<replacement>
|
||||||
|
<token>^(#.*$[\n\r]*)</token>
|
||||||
|
<value></value>
|
||||||
|
</replacement>
|
||||||
|
</replacements>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<!-- add swagger-ui as resource to output package -->
|
<!-- add swagger-ui as resource to output package -->
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -179,12 +231,18 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
<version>3.0.2</version>
|
<version>3.2.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<archive>
|
<archive>
|
||||||
<manifest>
|
<manifest>
|
||||||
|
<addDefaultEntries>false</addDefaultEntries>
|
||||||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
<manifestEntries>
|
||||||
|
<Last-Commit-Id>${git.commit.id.full}</Last-Commit-Id>
|
||||||
|
<Last-Commit-Time>${git.commit.time}</Last-Commit-Time>
|
||||||
|
<Reproducible-Build>true</Reproducible-Build>
|
||||||
|
</manifestEntries>
|
||||||
</archive>
|
</archive>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
@ -208,6 +266,7 @@
|
|||||||
<exclude>META-INF/*.SF</exclude>
|
<exclude>META-INF/*.SF</exclude>
|
||||||
<exclude>META-INF/*.DSA</exclude>
|
<exclude>META-INF/*.DSA</exclude>
|
||||||
<exclude>META-INF/*.RSA</exclude>
|
<exclude>META-INF/*.RSA</exclude>
|
||||||
|
<exclude>**/*.js.map</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
</filter>
|
</filter>
|
||||||
</filters>
|
</filters>
|
||||||
@ -234,6 +293,23 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>io.github.zlika</groupId>
|
||||||
|
<artifactId>reproducible-build-maven-plugin</artifactId>
|
||||||
|
<version>0.11</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<id>strip-jar</id>
|
||||||
|
<goals>
|
||||||
|
<goal>strip-jar</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<zipDateTime>${git.commit.time}</zipDateTime>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
<pluginManagement>
|
<pluginManagement>
|
||||||
<plugins>
|
<plugins>
|
||||||
@ -360,6 +436,16 @@
|
|||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-annotations</artifactId>
|
<artifactId>jackson-annotations</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
|
<!-- exclude Netty, as included by io.druid.java.util -->
|
||||||
|
<exclusion>
|
||||||
|
<groupId>io.netty</groupId>
|
||||||
|
<artifactId>netty</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<!-- exclude async-http-client, as included by io.druid.java.util -->
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.asynchttpclient</groupId>
|
||||||
|
<artifactId>async-http-client</artifactId>
|
||||||
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- For NTP -->
|
<!-- For NTP -->
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
build.timestamp=${build.timestamp}
|
build.timestamp=${git.commit.time}
|
||||||
build.version=${project.version}
|
build.version=${project.version}-${git.commit.id.abbrev}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user