[MDEP-391] Unpack fails on linux with large archives
add ignorePermissions flag
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1414637 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java b/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java
index e9f541c..ec7f096 100644
--- a/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java
+++ b/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java
@@ -104,7 +104,14 @@
* @since 2.5.1
*/
@Parameter( property = "dependency.useJvmChmod", defaultValue = "true" )
- protected boolean useJvmChmod;
+ protected boolean useJvmChmod = true;
+
+ /**
+ * ignore to set file permissions when unpacking a dependency
+ * @since 2.7
+ */
+ @Parameter( property = "dependency.ignorePermissions", defaultValue = "true" )
+ protected boolean ignorePermissions = true;
/**
* POM
@@ -206,7 +213,7 @@
/**
* Unpacks the archive file.
*
- * @param file File to be unpacked.
+ * @param artifact File to be unpacked.
* @param location Location where to put the unpacked files.
* @param includes Comma separated list of file patterns to include i.e. <code>**/.xml,
* **/*.properties</code>
@@ -245,6 +252,8 @@
unArchiver.setUseJvmChmod( useJvmChmod );
+ unArchiver.setIgnorePermissions( this.ignorePermissions );
+
unArchiver.setSourceFile( file );
unArchiver.setDestDirectory( location );