Skip to content

Commit

Permalink
make following symlinks configurable in plexus-archiver
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mirabilos committed Jan 8, 2021
1 parent 90ec7b2 commit 11bee26
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/main/java/org/codehaus/plexus/archiver/AbstractArchiver.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ public abstract class AbstractArchiver
*/
private String overrideGroupName;

/**
* @since 4.3.1
*/
private boolean followSymlinks = true;

// contextualized.
private ArchiverManager archiverManager;

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

collection.setIncludes( fileSet.getIncludes() );
collection.setExcludes( fileSet.getExcludes() );
Expand Down Expand Up @@ -1299,4 +1304,14 @@ protected Date normalizeLastModifiedDate( Date lastModifiedDate )
{
return lastModifiedDate;
}

boolean getFollowSymlinks()
{
return followSymlinks;
}

void setFollowSymlinks( boolean follow )
{
followSymlinks = follow;
}
}
10 changes: 10 additions & 0 deletions src/main/java/org/codehaus/plexus/archiver/Archiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -476,4 +476,14 @@ ResourceIterator getResources()
* @since 4.2.0
*/
void configureReproducible( Date lastModifiedDate );

/**
* @since 4.3.1
*/
boolean getFollowSymlinks();

/**
* @since 4.3.1
*/
void setFollowSymlinks( boolean follow );
}

0 comments on commit 11bee26

Please sign in to comment.