cstamas commented on a change in pull request #12:
URL: https://github.com/apache/maven-deploy-plugin/pull/12#discussion_r541560654



##########
File path: src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
##########
@@ -248,19 +249,40 @@ else if ( !ArtifactUtils.isSnapshot( project.getVersion() 
) && altReleaseDeploym
         {
             getLog().info( "Using alternate deployment repository " + 
altDeploymentRepo );
 
-            Matcher matcher = ALT_REPO_SYNTAX_PATTERN.matcher( 
altDeploymentRepo );
+            Matcher matcher = ALT_LEGACY_REPO_SYNTAX_PATTERN.matcher( 
altDeploymentRepo );
 
-            if ( !matcher.matches() )
+            if ( matcher.matches() )
             {
-                throw new MojoFailureException( altDeploymentRepo, "Invalid 
syntax for repository.",
-                                                "Invalid syntax for 
alternative repository. Use \"id::url\"." );
+                getLog().warn( "Legacy form of alternate deployment parameter 
used, update parameter to match plugin version." );

Review comment:
       Will rework the PR then as follows:
   * Mojo will first match LEGACY pattern, 
   * if matched, build will fail, but the message will be saying what the 
problem is (legacy notation) and provide solution (modern notation), will not 
"magically" continue if layout is `default`
   * continue with current pattern... 
   
   This order (legacy then modern) is needed, as we saw, that modern pattern 
"matches" legacy notation, but messes up repositoryId (ends up w/ 
`serverId::default` and fails to find serverId in settings). This way, we 
exclude that possibility to have 2 (legacy), 3 (plain wrong) and more `::`s in 
string, as all those will be caught by legacy pattern (and in that case would 
provide bad "solution".
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to