[MDEPLOY-211] uniqueVersion broken (if not supported, should be removed from doc, and warning printed)

The parameter uniqueVersion in the deploy-file goal isn't supported since Maven 3, so it is removed from the code base and from the documentation of the plugin. A check is made to fail the build if it is still used, and the index page mentions the removal.

git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1769339 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/it/MDEPLOY-169_deploy-at-end-multithread/pom.xml b/src/it/MDEPLOY-169_deploy-at-end-multithread/pom.xml
index b1913bd..576847d 100644
--- a/src/it/MDEPLOY-169_deploy-at-end-multithread/pom.xml
+++ b/src/it/MDEPLOY-169_deploy-at-end-multithread/pom.xml
@@ -39,7 +39,6 @@
     <repository>

       <id>it</id>

       <url>file:///${basedir}/target/repo</url>

-      <uniqueVersion>false</uniqueVersion>

     </repository>

   </distributionManagement>

 

diff --git a/src/it/MDEPLOY-170_deploy-at-end-configperproject/pom.xml b/src/it/MDEPLOY-170_deploy-at-end-configperproject/pom.xml
index 3e7d3cc..42f53da 100644
--- a/src/it/MDEPLOY-170_deploy-at-end-configperproject/pom.xml
+++ b/src/it/MDEPLOY-170_deploy-at-end-configperproject/pom.xml
@@ -39,7 +39,6 @@
     <repository>

       <id>it</id>

       <url>file:///${basedir}/target/repo</url>

-      <uniqueVersion>false</uniqueVersion>

     </repository>

   </distributionManagement>

 

diff --git a/src/it/MDEPLOY-202_deployfile-with-multiple-executions/pom.xml b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/pom.xml
index d52e448..a9a9992 100644
--- a/src/it/MDEPLOY-202_deployfile-with-multiple-executions/pom.xml
+++ b/src/it/MDEPLOY-202_deployfile-with-multiple-executions/pom.xml
@@ -38,7 +38,6 @@
     <repository>

       <id>it</id>

       <url>file:///${basedir}/target/repo</url>

-      <uniqueVersion>false</uniqueVersion>

     </repository>

   </distributionManagement>

 

diff --git a/src/it/MDEPLOY-213/pom.xml b/src/it/MDEPLOY-213/pom.xml
index 23a1848..7688d37 100644
--- a/src/it/MDEPLOY-213/pom.xml
+++ b/src/it/MDEPLOY-213/pom.xml
@@ -37,7 +37,6 @@
     <repository>
       <id>it</id>
       <url>file://${basedir}/target/repo</url>
-      <uniqueVersion>false</uniqueVersion>
     </repository>
   </distributionManagement>
   
diff --git a/src/it/attach-release-jar/pom.xml b/src/it/attach-release-jar/pom.xml
index 035707c..3d2039e 100644
--- a/src/it/attach-release-jar/pom.xml
+++ b/src/it/attach-release-jar/pom.xml
@@ -40,7 +40,6 @@
     <repository>
       <id>it</id>
       <url>file:///${basedir}/target/repo</url>
-      <uniqueVersion>false</uniqueVersion>
     </repository>
   </distributionManagement>
 
diff --git a/src/it/deploy-at-end-fail/pom.xml b/src/it/deploy-at-end-fail/pom.xml
index 92e45b0..be9ef50 100644
--- a/src/it/deploy-at-end-fail/pom.xml
+++ b/src/it/deploy-at-end-fail/pom.xml
@@ -39,7 +39,6 @@
     <repository>
       <id>it</id>
       <url>file:///${basedir}/target/repo</url>
-      <uniqueVersion>false</uniqueVersion>
     </repository>
   </distributionManagement>
 
diff --git a/src/it/deploy-at-end-pass/pom.xml b/src/it/deploy-at-end-pass/pom.xml
index 8021f6a..ecf739a 100644
--- a/src/it/deploy-at-end-pass/pom.xml
+++ b/src/it/deploy-at-end-pass/pom.xml
@@ -39,7 +39,6 @@
     <repository>
       <id>it</id>
       <url>file:///${basedir}/target/repo</url>
-      <uniqueVersion>false</uniqueVersion>
     </repository>
   </distributionManagement>
 
diff --git a/src/it/offline/pom.xml b/src/it/offline/pom.xml
index c604314..32e53ec 100644
--- a/src/it/offline/pom.xml
+++ b/src/it/offline/pom.xml
@@ -39,7 +39,6 @@
     <repository>
       <id>it</id>
       <url>file:///${basedir}/target/repo</url>
-      <uniqueVersion>false</uniqueVersion>
     </repository>
   </distributionManagement>
 
diff --git a/src/it/release-jar/pom.xml b/src/it/release-jar/pom.xml
index a4e0ead..51fe248 100644
--- a/src/it/release-jar/pom.xml
+++ b/src/it/release-jar/pom.xml
@@ -40,7 +40,6 @@
     <repository>
       <id>it</id>
       <url>file:///${basedir}/target/repo</url>
-      <uniqueVersion>false</uniqueVersion>
     </repository>
   </distributionManagement>
 
diff --git a/src/it/release-pom/pom.xml b/src/it/release-pom/pom.xml
index ec19a46..526fb37 100644
--- a/src/it/release-pom/pom.xml
+++ b/src/it/release-pom/pom.xml
@@ -40,7 +40,6 @@
     <repository>
       <id>it</id>
       <url>file:///${basedir}/target/repo</url>
-      <uniqueVersion>false</uniqueVersion>
     </repository>
   </distributionManagement>
 
diff --git a/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
index bc9c4c0..504806e 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
@@ -104,8 +104,7 @@
     }
 
     protected ArtifactRepository createDeploymentArtifactRepository( String id, String url,
-                                                                     ArtifactRepositoryLayout layout,
-                                                                     boolean uniqueVersion2 )
+                                                                     ArtifactRepositoryLayout layout )
     {
         return new MavenArtifactRepository( id, url, layout, new ArtifactRepositoryPolicy(),
                                             new ArtifactRepositoryPolicy() );
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
index 9afe7ea..73b4425 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
@@ -191,9 +191,13 @@
 
     /**
      * Whether to deploy snapshots with a unique version or not.
+     * 
+     * @deprecated As of Maven 3, this isn't supported anymore and this parameter is only present to break the build
+     * if you use it!
      */
-    @Parameter( property = "uniqueVersion", defaultValue = "true" )
-    private boolean uniqueVersion;
+    @Parameter( property = "uniqueVersion" )
+    @Deprecated
+    private Boolean uniqueVersion;
 
     /**
      * The component used to validate the user-supplied artifact coordinates.
@@ -324,6 +328,13 @@
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
+        if ( uniqueVersion != null )
+        {
+            throw new MojoExecutionException( "You are using 'uniqueVersion' which has been removed"
+                + " from the maven-deploy-plugin. "
+                + "Please see the >>Major Version Upgrade to version 3.0.0<< on the plugin site." );
+        }
+
         failIfOffline();
 
         if ( !file.exists() )
@@ -338,7 +349,7 @@
         ArtifactRepositoryLayout layout = getLayout( repositoryLayout );
 
         ArtifactRepository deploymentRepository =
-            createDeploymentArtifactRepository( repositoryId, url, layout, uniqueVersion );
+            createDeploymentArtifactRepository( repositoryId, url, layout );
 
         String protocol = deploymentRepository.getProtocol();
 
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
index 02c0880..b626d31 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
@@ -252,7 +252,7 @@
 
                 ArtifactRepositoryLayout repoLayout = getLayout( layout );
 
-                repo = createDeploymentArtifactRepository( id, url, repoLayout, true );
+                repo = createDeploymentArtifactRepository( id, url, repoLayout );
             }
         }
 
diff --git a/src/site/apt/file-deployment.apt b/src/site/apt/file-deployment.apt
index ee12140..a886cbf 100644
--- a/src/site/apt/file-deployment.apt
+++ b/src/site/apt/file-deployment.apt
@@ -38,8 +38,6 @@
 
   * {{{./examples/deploying-sources-javadoc.html}Deploy an artifact with sources and javadoc jars}}
 
-  * {{{./examples/disabling-timestamps-suffix.html}Disable timestamps suffix in an artifact}}
-
   * {{{./examples/deploying-in-legacy-layout.html}Deploy an artifact in legacy layout}}
 
   []
\ No newline at end of file
diff --git a/src/site/apt/index.apt.vm b/src/site/apt/index.apt.vm
index fedbe54..c5e814e 100644
--- a/src/site/apt/index.apt.vm
+++ b/src/site/apt/index.apt.vm
@@ -75,6 +75,16 @@
 
    []
 
+* Major Version Upgrade to version 3.0.0
+
+  Please note that the following parameter has been completely removed from the plugin configuration:
+
+  * uniqueVersion
+  
+  []
+
+  As of Maven 3, snapshot artifacts will always be deployed using a timestamped version.
+
 * Usage
 
   General instructions on how to use the Deploy Plugin can be found on the {{{./usage.html}usage page}}. Some more
diff --git a/src/site/apt/usage.apt b/src/site/apt/usage.apt
index 156e027..8eafe93 100644
--- a/src/site/apt/usage.apt
+++ b/src/site/apt/usage.apt
@@ -119,8 +119,7 @@
                        [-Dclassifier=test] \
                        [-DgeneratePom=true] \
                        [-DgeneratePom.description="My Project Description"] \
-                       [-DrepositoryLayout=legacy] \
-                       [-DuniqueVersion=false]
+                       [-DrepositoryLayout=legacy]
 +---+
 
   If the following required information is not specified in some way, the goal
diff --git a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
index 17e63c1..e88bfb5 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
@@ -600,9 +600,8 @@
         setVariableValueToObject( mojo, "repositoryLayouts", Collections.singletonMap( "default", repositoryLayout ) );
 
         ArtifactRepository repository = mock( ArtifactRepository.class );
-        when(
-              mojo.createDeploymentArtifactRepository( "altSnapshotDeploymentRepository", "http://localhost",
-                                                       repositoryLayout, true ) ).thenReturn( repository );
+        when( mojo.createDeploymentArtifactRepository( "altSnapshotDeploymentRepository", "http://localhost",
+                                                       repositoryLayout ) ).thenReturn( repository );
 
         project.setVersion( "1.0-SNAPSHOT" );
 
@@ -623,9 +622,8 @@
         setVariableValueToObject( mojo, "repositoryLayouts", Collections.singletonMap( "default", repositoryLayout ) );
 
         ArtifactRepository repository = mock( ArtifactRepository.class );
-        when(
-              mojo.createDeploymentArtifactRepository( "altReleaseDeploymentRepository", "http://localhost",
-                                                       repositoryLayout, true ) ).thenReturn( repository );
+        when( mojo.createDeploymentArtifactRepository( "altReleaseDeploymentRepository", "http://localhost",
+                                                       repositoryLayout ) ).thenReturn( repository );
 
         project.setVersion( "1.0" );
 
diff --git a/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml b/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml
index f9b092e..4c7fc95 100644
--- a/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml
+++ b/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml
@@ -29,7 +29,6 @@
           <file>${basedir}/src/test/resources/unit/deploy-file-artifact-not-jar/target/deploy-test-file.zip</file>
           <repositoryId>deploy-test</repositoryId>
           <url>file://${basedir}/target/remote-repo/deploy-file-artifact-not-jar</url>
-          <uniqueVersion>true</uniqueVersion>
           <repositoryLayout>default</repositoryLayout>
           <generatePom>true</generatePom>
         </configuration>
diff --git a/src/test/resources/unit/deploy-file-classifier/plugin-config.xml b/src/test/resources/unit/deploy-file-classifier/plugin-config.xml
index 7929357..59e0945 100644
--- a/src/test/resources/unit/deploy-file-classifier/plugin-config.xml
+++ b/src/test/resources/unit/deploy-file-classifier/plugin-config.xml
@@ -30,7 +30,6 @@
           <file>${basedir}/src/test/resources/unit/deploy-file-classifier/target/deploy-test-file-1.0-SNAPSHOT.jar</file>
           <repositoryId>deploy-test</repositoryId>
           <url>file://${basedir}/target/remote-repo/deploy-file-classifier</url>
-          <uniqueVersion>true</uniqueVersion>
           <classifier>bin</classifier>
           <repositoryLayout>default</repositoryLayout>
           <generatePom>true</generatePom>
diff --git a/src/test/resources/unit/deploy-file-legacy-repository-layout/plugin-config.xml b/src/test/resources/unit/deploy-file-legacy-repository-layout/plugin-config.xml
index d59b015..97531f1 100644
--- a/src/test/resources/unit/deploy-file-legacy-repository-layout/plugin-config.xml
+++ b/src/test/resources/unit/deploy-file-legacy-repository-layout/plugin-config.xml
@@ -30,7 +30,6 @@
           <file>${basedir}/src/test/resources/unit/deploy-file-legacy-repository-layout/target/deploy-test-file-1.0-SNAPSHOT.jar</file>
           <repositoryId>deploy-test</repositoryId>
           <url>file://${basedir}/target/remote-repo/deploy-file-legacy-repository-layout</url>
-          <uniqueVersion>true</uniqueVersion>
           <repositoryLayout>legacy</repositoryLayout>
           <generatePom>true</generatePom>
         </configuration>
diff --git a/src/test/resources/unit/deploy-file-pom-file/plugin-config.xml b/src/test/resources/unit/deploy-file-pom-file/plugin-config.xml
index d1e9b0e..97f60b0 100644
--- a/src/test/resources/unit/deploy-file-pom-file/plugin-config.xml
+++ b/src/test/resources/unit/deploy-file-pom-file/plugin-config.xml
Binary files differ
diff --git a/src/test/resources/unit/deploy-file-test/plugin-config.xml b/src/test/resources/unit/deploy-file-test/plugin-config.xml
index 8dd3915..78c4c1e 100644
--- a/src/test/resources/unit/deploy-file-test/plugin-config.xml
+++ b/src/test/resources/unit/deploy-file-test/plugin-config.xml
@@ -31,7 +31,6 @@
           <repositoryId>deploy-test</repositoryId>
           <url>file://${basedir}/target/remote-repo/deploy-file-test</url>
           <description>POM was created from deploy:deploy-file</description>
-          <uniqueVersion>true</uniqueVersion>
           <repositoryLayout>default</repositoryLayout>
           <generatePom>true</generatePom>
         </configuration>