You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2020/12/12 10:47:44 UTC

[GitHub] [maven-deploy-plugin] mickroll commented on a change in pull request #12: [MDEPLOY-279] Better validation for alt deploy repository mojo parameter

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



##########
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:
       This message hides a lot of information that was gathered before. At this point, the plugin knows that `id::layout::url` was used (but expects `id::url`, of course). The message should reflect that, not just by saying `you used the old notation, use the new one. RTFM`, but more like `you used the 2.x notation id::layout::url, 3.x expects id::url`.
   This would give not just a hint to whats wrong, but provide a solution... To me, this is the difference of a good plugin to a great one :sunglasses:
   With this, it would be totally fine (and expected) to fail with the message, not continuing the build 'magically' if the layout is `default`.




----------------------------------------------------------------
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:
users@infra.apache.org