Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ under the License.
<!-- default packaging: jar -->

<properties>
<project.build.outputTimestamp>1</project.build.outputTimestamp>
<project.build.outputTimestamp>2000-01-01T00:00:00Z</project.build.outputTimestamp>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
* under the License.
*/

import java.time.LocalDateTime
import java.time.ZoneId
import java.util.zip.ZipEntry
import java.util.zip.ZipFile


String manifest = new File( basedir, "target/classes/META-INF/MANIFEST.MF" ).text;

assert !manifest.contains( "Build-Jdk:" )
Expand All @@ -25,3 +31,14 @@ assert manifest.contains( "Build-Jdk-Spec:" )
assert !manifest.contains( "Build-By:" )

assert !manifest.contains( "Bnd-LastModified:" )


Enumeration<? extends ZipEntry> bundleEntries = new ZipFile(new File( basedir, "target/reproducible-1-SNAPSHOT.jar" )).entries()

// ZipEntry::getTime() interprets the time information in the local timezone.
long expectedTime = LocalDateTime.of(2000, 1, 1, 0, 0, 0).atZone(ZoneId.systemDefault()).toEpochSecond() * 1000

while(bundleEntries.hasMoreElements()) {
ZipEntry entry = bundleEntries.nextElement()
assert entry.getTime() == expectedTime
}
2 changes: 1 addition & 1 deletion tools/maven-bundle-plugin/src/it/reproducible/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ under the License.
<version>1-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<project.build.outputTimestamp>1</project.build.outputTimestamp>
<project.build.outputTimestamp>946684800</project.build.outputTimestamp>
</properties>
<dependencies>
<dependency>
Expand Down
17 changes: 17 additions & 0 deletions tools/maven-bundle-plugin/src/it/reproducible/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
* under the License.
*/

import java.time.LocalDateTime
import java.time.ZoneId
import java.util.zip.ZipEntry
import java.util.zip.ZipFile


String manifest = new File( basedir, "target/classes/META-INF/MANIFEST.MF" ).text;

assert !manifest.contains( "Build-Jdk:" )
Expand All @@ -25,3 +31,14 @@ assert manifest.contains( "Build-Jdk-Spec:" )
assert !manifest.contains( "Build-By:" )

assert !manifest.contains( "Bnd-LastModified:" )


Enumeration<? extends ZipEntry> bundleEntries = new ZipFile(new File( basedir, "target/reproducible-1-SNAPSHOT.jar" )).entries()

// ZipEntry::getTime() interprets the time information in the local timezone.
long expectedTime = LocalDateTime.of(2000, 1, 1, 0, 0, 0).atZone(ZoneId.systemDefault()).toEpochSecond() * 1000

while(bundleEntries.hasMoreElements()) {
ZipEntry entry = bundleEntries.nextElement()
assert entry.getTime() == expectedTime
}
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ protected Builder getOSGiBuilder( MavenProject currentProject, Map<String, Strin

if ( new MavenArchiver().parseOutputTimestamp( outputTimestamp ) != null )
{
properties.put( Constants.REPRODUCIBLE, "true" );
properties.put( Constants.REPRODUCIBLE, outputTimestamp );
}

// process overrides from project
Expand Down