This is an automated email from the ASF dual-hosted git repository.

skygo pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/netbeans-mavenutils-nbm-maven-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 425ff58  There can be space in between URL: and m2://
     new f96a692  Merge pull request #3 from jtulach/SpaceBeforeM2
425ff58 is described below

commit 425ff582437b0896b3a56c5b7b2929081408453a
Author: Jaroslav Tulach <jaroslav.tul...@apidesign.org>
AuthorDate: Wed Oct 2 06:11:37 2019 +0200

    There can be space in between URL: and m2://
---
 .../apache/netbeans/nbm/CreateClusterAppMojo.java  | 51 +++++++++++-----------
 1 file changed, 26 insertions(+), 25 deletions(-)

diff --git a/src/main/java/org/apache/netbeans/nbm/CreateClusterAppMojo.java 
b/src/main/java/org/apache/netbeans/nbm/CreateClusterAppMojo.java
index c5f0469..02ac0ac 100644
--- a/src/main/java/org/apache/netbeans/nbm/CreateClusterAppMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/CreateClusterAppMojo.java
@@ -934,7 +934,7 @@ public class CreateClusterAppMojo
         return new ClusterTuple( clusterFile, newer );
     }
 
-    private void externalDownload( File f, InputStream is )
+        private void externalDownload( File f, InputStream is )
         throws IOException
     {
         // Cf. org.netbeans.nbbuild.AutoUpdate
@@ -949,35 +949,36 @@ public class CreateClusterAppMojo
             {
                 crc = Long.parseLong( line.substring( 4 ).trim() );
             }
-            else if ( line.startsWith( "URL:m2:/" ) )
+            else if ( line.startsWith( "URL:" ) )
             {
-                if ( ! found )
+                String rest = line.substring(4).trim();
+                if ( rest.startsWith( "m2:/" ) )
                 {
-                    String[] coords = line.substring( 8 ).trim().split( ":" );
-                    Artifact artifact;
-                    if ( coords.length == 4 )
-                    {
-                        artifact = artifactFactory.createArtifact( coords[0], 
coords[1], coords[2], null, coords[3] );
-                    }
-                    else
-                    {
-                        artifact = 
artifactFactory.createArtifactWithClassifier( coords[0], coords[1], coords[2], 
coords[3], coords[4] );
-                    }
-                    try
+                    if ( ! found )
                     {
-                        artifactResolver.resolve( artifact, 
project.getRemoteArtifactRepositories(), localRepository );
-                        FileUtils.copyFile( artifact.getFile(), f );
-                        found = true;
-                    }
-                    catch ( AbstractArtifactResolutionException x )
-                    {
-                        getLog().warn( "Cannot find " + line.substring( 8 ), x 
);
+                        String[] coords = rest.substring( 4 ).trim().split( 
":" );
+                        Artifact artifact;
+                        if ( coords.length == 4 )
+                        {
+                            artifact = artifactFactory.createArtifact( 
coords[0], coords[1], coords[2], null, coords[3] );
+                        }
+                        else
+                        {
+                            artifact = 
artifactFactory.createArtifactWithClassifier( coords[0], coords[1], coords[2], 
coords[3], coords[4] );
+                        }
+                        try
+                        {
+                            artifactResolver.resolve( artifact, 
project.getRemoteArtifactRepositories(), localRepository );
+                            FileUtils.copyFile( artifact.getFile(), f );
+                            found = true;
+                        }
+                        catch ( AbstractArtifactResolutionException x )
+                        {
+                            getLog().warn( "Cannot find " + line.substring( 8 
), x );
+                        }
                     }
                 }
-            }
-            else if ( line.startsWith( "URL:" ) )
-            {
-                if ( ! found )
+                else if ( ! found )
                 {
                     String url = line.substring( 4 ).trim();
                     try


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to