deploy snapshots with a unique version by default


git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-deploy-plugin@381065 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
index 2cf510e..451a97c 100644
--- a/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
@@ -137,7 +137,14 @@
      * @parameter expression="${classifier}";

      */

     private String classifier;

-    

+

+    /**

+     * Whether to deploy snapshots with a unique version or not.

+     *

+     * @parameter expression="${uniqueVersion}" default-value="true"

+     */

+    private boolean uniqueVersion;

+

 

     public void execute()

         throws MojoExecutionException

@@ -146,14 +153,14 @@
         initProperties();

 

         Artifact pomArtifact = null;

-        

+

         try

         {

             // Create the artifact

             Artifact artifact = artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, packaging, classifier );

-            

+

             ArtifactRepository deploymentRepository = repositoryFactory

-                .createDeploymentArtifactRepository( repositoryId, url, layout, false );

+                .createDeploymentArtifactRepository( repositoryId, url, layout, uniqueVersion );

 

             // Upload the POM if requested, generating one if need be

             if ( generatePom )

@@ -185,7 +192,7 @@
                 throw new MojoExecutionException( "No transfer protocol found." );

             }

             getDeployer().deploy( file, artifact, deploymentRepository, getLocalRepository() );

-            

+

             if( isPomFileExisting() && generatePom == false )

             {

                 getDeployer().deploy( pomFile, pomArtifact, deploymentRepository, getLocalRepository() );