karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Markevich (JIRA)" <j...@apache.org>
Subject [jira] Commented: (KARAF-526) add-features-to-repo: descriptor with file contains spaces on unix
Date Fri, 18 Mar 2011 16:24:29 GMT

    [ https://issues.apache.org/jira/browse/KARAF-526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13008497#comment-13008497
] 

Alexey Markevich commented on KARAF-526:
----------------------------------------

This method called from
org.apache.karaf.tooling.features.AddFeaturesToRepoMojo.execute() line 130:
                Repository repo = new Repository(URI.create(translateFromMaven(uri)));
So problem with URI object creation will be solved by replacing spaces with %20

> add-features-to-repo: descriptor with file contains spaces on unix
> ------------------------------------------------------------------
>
>                 Key: KARAF-526
>                 URL: https://issues.apache.org/jira/browse/KARAF-526
>             Project: Karaf
>          Issue Type: Bug
>          Components: tooling
>    Affects Versions: 2.1.4
>         Environment: unix
>            Reporter: Alexey Markevich
>            Assignee: Jean-Baptiste Onofré
>   Original Estimate: 1m
>  Remaining Estimate: 1m
>
> Configuration:
> <groupId>org.apache.karaf.tooling</groupId>
> <artifactId>features-maven-plugin</artifactId>
>  <executions>
>   <execution>
>    <goals>
>     <goal>add-features-to-repo</goal>
>    </goals>
>    <configuration>
>     <descriptors>
>      <descriptor>file:${basedir}/target/classes/activemq-features.xml</descriptor>
> ${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)
> 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");
>             }
>         }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message