Compare commits

1 Commits
main ... 1.1

3 changed files with 1 additions and 31 deletions

View File

@@ -1,13 +1,3 @@
-------------------------------------------------------------------
Mon Sep 23 10:09:21 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Use SOURCE_DATE_EPOCH for reproducible builds
- Added patch:
* reproducible-from-environment.patch
+ SOURCE_DATE_EPOCH environmental variable triggers reproducible
use of the maven-jar-plugin if it is not requested already
using the project.build.outputTimestamp option.
-------------------------------------------------------------------
Wed Feb 21 05:59:39 UTC 2024 - Fridrich Strba <fstrba@suse.com>

View File

@@ -33,7 +33,6 @@ Source0: https://repo1.maven.org/maven2/org/apache/maven/plugins/%{base_n
Source1: %{base_name}-build.xml
Patch0: %{base_name}-bootstrap-resources.patch
Patch1: 01-allow-replacing-artifacts.patch
Patch2: reproducible-from-environment.patch
BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local
@@ -89,7 +88,6 @@ cp %{SOURCE1} build.xml
%patch -P 0 -p1
%endif
%patch -P 1 -p1
%patch -P 2 -p1
# Remove all dependencies with scope test, since a raw xmvn does not hide them
%pom_remove_dep -r :::test:
@@ -110,11 +108,10 @@ build-jar-repository -s lib \
%{ant} -Dtest.skip=true jar
%else
xmvn --batch-mode --offline \
-Dmaven.test.skip=true -DmavenVersion=3.1.1 \
%if %{?pkg_vcmp:%pkg_vcmp java-devel >= 9}%{!?pkg_vcmp:0}
-Dmaven.compiler.release=8 \
%endif
-Dmaven.test.skip=true -DmavenVersion=3.1.1 \
-Dproject.build.outputTimestamp=$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ) \
package org.apache.maven.plugins:maven-javadoc-plugin:aggregate
%endif

View File

@@ -1,17 +0,0 @@
--- maven-jar-plugin-3.3.0/src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java 2024-09-23 11:44:25.479106748 +0200
+++ maven-jar-plugin-3.3.0/src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java 2024-09-23 12:10:05.439871672 +0200
@@ -251,6 +251,14 @@
archiver.setArchiver( (JarArchiver) archivers.get( archiverName ) );
archiver.setOutputFile( jarFile );
+ if ( outputTimestamp == null ||
+ outputTimestamp.length() < 1 ||
+ ( ( outputTimestamp.length() == 1 )
+ && !Character.isDigit( outputTimestamp.charAt(0) ) ) )
+ {
+ outputTimestamp = System.getenv("SOURCE_DATE_EPOCH");
+ }
+
// configure for Reproducible Builds based on outputTimestamp value
archiver.configureReproducibleBuild( outputTimestamp );