You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by amarkevich <am...@talend.com> on 2011/03/17 18:08:18 UTC

[features-maven-plugin] descriptor with file contains spaces on unix

Hello,

Configuration:
org.apache.karaf.tooling
features-maven-plugin
 
  
   
    add-features-to-repo
   
   
    
     file:${basedir}/target/classes/activemq-features.xml

${basedir} contains spaces at target PC. Result:
Caused by: java.lang.IllegalArgumentException
	at java.net.URI.create(URI.java:842)
	at
org.apache.karaf.tooling.features.AddFeaturesToRepoMojo.execute(AddFeaturesToRepoMojo.java:130)

Karaf 2.1.4.

Looking into sources I found
org.apache.karaf.tooling.features.MojoSupport.translateFromMaven()
There is a check for windows and replacement spaces with %20.
Simple fix:

        } else if (uri.startsWith("file:")) {
            if (System.getProperty("os.name").startsWith("Windows")) {
                    String baseDir = uri.substring(5).replace('\\',
'/').replaceAll(" ", "%20");
                    String result = baseDir;
                    if (baseDir.indexOf(":") > 0) {
                            result = "file:///" + baseDir;
                    }
                    return result;
            } else {
                return uri.replaceAll(" ", "%20");
            }
        }

Regards, Alexey.

--
View this message in context: http://karaf.922171.n3.nabble.com/features-maven-plugin-descriptor-with-file-contains-spaces-on-unix-tp2694391p2694391.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.

Re: [features-maven-plugin] descriptor with file contains spaces on unix

Posted by Andreas Pieber <an...@gmail.com>.
Hey Alexey,

Can you please create a JIRA for this problem?

Thank you very much and kind regards,
Andreas