maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From khmarba...@apache.org
Subject svn commit: r1661356 - in /maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency: fromConfiguration/CopyMojo.java fromDependencies/CopyDependenciesMojo.java utils/filters/DestFileFilter.java
Date Sat, 21 Feb 2015 13:13:23 GMT
Author: khmarbaise
Date: Sat Feb 21 13:13:23 2015
New Revision: 1661356

URL: http://svn.apache.org/r1661356
Log:
[MDEP-478] dependency:copy-dependencies always overwrites if <prependGroupId> is true
 Patch of Julius Davies applied.

Modified:
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromDependencies/CopyDependenciesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java?rev=1661356&r1=1661355&r2=1661356&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java
Sat Feb 21 13:13:23 2015
@@ -138,7 +138,8 @@ public class CopyMojo
     {
         ArtifactItemFilter destinationNameOverrideFilter =
             new DestFileFilter( this.isOverWriteReleases(), this.isOverWriteSnapshots(),
this.isOverWriteIfNewer(),
-                                false, false, false, false, this.stripVersion, item.getOutputDirectory()
);
+                                false, false, false, false, this.stripVersion, prependGroupId,
useBaseVersion,
+                                item.getOutputDirectory() );
         return destinationNameOverrideFilter;
     }
 

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromDependencies/CopyDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromDependencies/CopyDependenciesMojo.java?rev=1661356&r1=1661355&r2=1661356&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromDependencies/CopyDependenciesMojo.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromDependencies/CopyDependenciesMojo.java
Sat Feb 21 13:13:23 2015
@@ -323,7 +323,7 @@ public class CopyDependenciesMojo
         return new DestFileFilter( this.overWriteReleases, this.overWriteSnapshots, this.overWriteIfNewer,
                                    this.useSubDirectoryPerArtifact, this.useSubDirectoryPerType,
                                    this.useSubDirectoryPerScope, this.useRepositoryLayout,
this.stripVersion,
-                                   this.outputDirectory );
+                                   this.prependGroupId, this.useBaseVersion, this.outputDirectory
);
     }
 
     /**

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java?rev=1661356&r1=1661355&r2=1661356&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java
Sat Feb 21 13:13:23 2015
@@ -56,25 +56,21 @@ public class DestFileFilter
     
     private boolean removeClassifier;
 
+    private boolean prependGroupId;
+
+    private boolean useBaseVersion;
+
     private File outputFileDirectory;
 
     public DestFileFilter( File outputFileDirectory )
     {
-        this.outputFileDirectory = outputFileDirectory;
-        overWriteReleases = false;
-        overWriteIfNewer = false;
-        overWriteSnapshots = false;
-        useSubDirectoryPerArtifact = false;
-        useSubDirectoryPerType = false;
-        useSubDirectoryPerScope = false;
-        removeVersion = false;
-        removeClassifier = false;
+        this( false, false, false, false, false, false, false, false, false, false, outputFileDirectory
);
     }
 
     public DestFileFilter( boolean overWriteReleases, boolean overWriteSnapshots, boolean
overWriteIfNewer,
                            boolean useSubDirectoryPerArtifact, boolean useSubDirectoryPerType,
                            boolean useSubDirectoryPerScope, boolean useRepositoryLayout,
boolean removeVersion,
-                           File outputFileDirectory )
+                           boolean prependGroupId, boolean useBaseVersion, File outputFileDirectory
)
     {
         this.overWriteReleases = overWriteReleases;
         this.overWriteSnapshots = overWriteSnapshots;
@@ -84,6 +80,8 @@ public class DestFileFilter
         this.useSubDirectoryPerScope = useSubDirectoryPerScope;
         this.useRepositoryLayout = useRepositoryLayout;
         this.removeVersion = removeVersion;
+        this.prependGroupId = prependGroupId;
+        this.useBaseVersion = useBaseVersion;
         this.outputFileDirectory = outputFileDirectory;
     }
 
@@ -283,7 +281,10 @@ public class DestFileFilter
         File destFile;
         if ( StringUtils.isEmpty( item.getDestFileName() ) )
         {
-            destFile = new File( destFolder, DependencyUtil.getFormattedFileName( artifact,
this.removeVersion ) );
+            String formattedFileName =
+                    DependencyUtil.getFormattedFileName( artifact, removeVersion, prependGroupId,
+                                                         useBaseVersion, removeClassifier
);
+            destFile = new File( destFolder, formattedFileName );
         }
         else
         {



Mime
View raw message