Skip to content

Commit d5b9878

Browse files
committed
[MSOURCES-123] set archiver reproducible mode earlier
1 parent 258d666 commit d5b9878

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

src/it/reproducible/invoker.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
invoker.goals=source:jar deploy:deploy
18+
invoker.goals=remote-resources:process source:jar deploy:deploy

src/it/reproducible/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@
6363
<altDeploymentRepository>mine::default::file://${basedir}/target/repo</altDeploymentRepository>
6464
</configuration>
6565
</plugin>
66+
<plugin>
67+
<groupId>org.apache.maven.plugins</groupId>
68+
<artifactId>maven-remote-resources-plugin</artifactId>
69+
<version>1.5</version>
70+
<configuration>
71+
<resourceBundles>
72+
<resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle>
73+
</resourceBundles>
74+
</configuration>
75+
</plugin>
6676
</plugins>
6777
</build>
6878

src/it/reproducible/verify.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ zipFile.close();
7272
String buf = r.toString()
7373
println buf
7474

75-
assert buf.startsWith( "reproducible-1.0-sources.jar sha1 = c505d059e036128fae3fcdd265fa51e14d7ae241" )
75+
assert buf.startsWith( "reproducible-1.0-sources.jar sha1 = 3a3687b063cfc164fbbccd1b9573b4232f540e8a" )

src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,6 @@ protected void packageSources( List<MavenProject> theProjects )
280280
}
281281

282282
MavenArchiver archiver = createArchiver();
283-
284-
// configure for Reproducible Builds based on outputTimestamp value
285-
archiver.configureReproducible( outputTimestamp );
286283

287284
for ( MavenProject pItem : theProjects )
288285
{
@@ -312,6 +309,7 @@ protected void packageSources( List<MavenProject> theProjects )
312309
archiver.setOutputFile( outputFile );
313310
archive.setForced( forceCreation );
314311

312+
getLog().debug( "create archive " + outputFile );
315313
archiver.createArchive( session, project, archive );
316314
}
317315
catch ( IOException e )
@@ -424,6 +422,10 @@ protected MavenArchiver createArchiver()
424422
archiver.setCreatedBy( "Maven Source Plugin", "org.apache.maven.plugins", "maven-source-plugin" );
425423
archiver.setBuildJdkSpecDefaultEntry( false );
426424

425+
426+
// configure for Reproducible Builds based on outputTimestamp value
427+
archiver.configureReproducible( outputTimestamp );
428+
427429
if ( project.getBuild() != null )
428430
{
429431
List<Resource> resources = project.getBuild().getResources();
@@ -454,6 +456,7 @@ protected void addDirectory( Archiver archiver, File sourceDirectory, String[] p
454456
{
455457
try
456458
{
459+
getLog().debug( "add directory " + sourceDirectory + " to archiver" );
457460
// archiver.addFileSet( fileSet );
458461
archiver.addDirectory( sourceDirectory, pIncludes, pExcludes );
459462
}
@@ -477,6 +480,7 @@ protected void addDirectory( Archiver archiver, File sourceDirectory, String pre
477480
{
478481
try
479482
{
483+
getLog().debug( "add directory " + sourceDirectory + " to archiver with prefix " + prefix );
480484
archiver.addDirectory( sourceDirectory, prefix, pIncludes, pExcludes );
481485
}
482486
catch ( ArchiverException e )

0 commit comments

Comments
 (0)