Skip to content

Commit 11bee26

Browse files
committed
make following symlinks configurable in plexus-archiver
default is still true here, will be false when submitting upstream REQUIRES a version of plexus-io with the following PR merged: codehaus-plexus/plexus-io#38 advances codehaus-plexus#160 even if I don’t know how to make this configurable from Maven
1 parent 90ec7b2 commit 11bee26

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

src/main/java/org/codehaus/plexus/archiver/AbstractArchiver.java

100755100644
+17-2
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ public abstract class AbstractArchiver
136136
*/
137137
private String overrideGroupName;
138138

139+
/**
140+
* @since 4.3.1
141+
*/
142+
private boolean followSymlinks = true;
143+
139144
// contextualized.
140145
private ArchiverManager archiverManager;
141146

@@ -367,8 +372,8 @@ public void addFileSet( @Nonnull final FileSet fileSet )
367372
// The PlexusIoFileResourceCollection contains platform-specific File.separatorChar which
368373
// is an interesting cause of grief, see PLXCOMP-192
369374
final PlexusIoFileResourceCollection collection = new PlexusIoFileResourceCollection();
370-
collection.setFollowingSymLinks( true );
371-
getLogger().info( "setFollowingSymLinks done" );
375+
collection.setFollowingSymLinks( followSymlinks );
376+
getLogger().info( "following (archiver): " + followSymlinks );
372377

373378
collection.setIncludes( fileSet.getIncludes() );
374379
collection.setExcludes( fileSet.getExcludes() );
@@ -1299,4 +1304,14 @@ protected Date normalizeLastModifiedDate( Date lastModifiedDate )
12991304
{
13001305
return lastModifiedDate;
13011306
}
1307+
1308+
boolean getFollowSymlinks()
1309+
{
1310+
return followSymlinks;
1311+
}
1312+
1313+
void setFollowSymlinks( boolean follow )
1314+
{
1315+
followSymlinks = follow;
1316+
}
13021317
}

src/main/java/org/codehaus/plexus/archiver/Archiver.java

+10
Original file line numberDiff line numberDiff line change
@@ -476,4 +476,14 @@ ResourceIterator getResources()
476476
* @since 4.2.0
477477
*/
478478
void configureReproducible( Date lastModifiedDate );
479+
480+
/**
481+
* @since 4.3.1
482+
*/
483+
boolean getFollowSymlinks();
484+
485+
/**
486+
* @since 4.3.1
487+
*/
488+
void setFollowSymlinks( boolean follow );
479489
}

0 commit comments

Comments
 (0)