You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Alexey Markevich (JIRA)" <ji...@apache.org> on 2011/03/18 09:23:29 UTC

[jira] Created: (KARAF-526) add-features-to-repo: descriptor with file contains spaces on unix

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


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

[jira] Commented: (KARAF-526) add-features-to-repo: descriptor with file contains spaces on unix

Posted by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13008499#comment-13008499 ] 

Jean-Baptiste Onofré commented on KARAF-526:
--------------------------------------------

Sorry I didn't see that we use an URI. In that case, %20 works fine on an URI (or URL).

I will update in this way.

> 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

[jira] [Assigned] (KARAF-526) add-features-to-repo: descriptor with file contains spaces on unix

Posted by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-526?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Baptiste Onofré reassigned KARAF-526:
------------------------------------------

    Assignee:     (was: Jean-Baptiste Onofré)
    
> 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: karaf-feature, karaf-tooling
>    Affects Versions: 2.1.4
>         Environment: unix
>            Reporter: Alexey Markevich
>             Fix For: 3.0.1, 3.1.0
>
>   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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (KARAF-526) add-features-to-repo: descriptor with file contains spaces on unix

Posted by "David Jencks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13008531#comment-13008531 ] 

David Jencks commented on KARAF-526:
------------------------------------

Trying to figure out how to encode uris yourself is never going to work as well as what's in the jdk.  If you use the right URI constructor the URI will do the encoding for you, with all the necessary escaped characters, correctly.  Although the URI javadoc doesn't really explain what to do, you can find the right constructor by looking at the Harmony URI implementation. If no one beats me to it I'll try to find some time to investigate.  

> 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

[jira] [Updated] (KARAF-526) add-features-to-repo: descriptor with file contains spaces on unix

Posted by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-526?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Baptiste Onofré updated KARAF-526:
---------------------------------------

    Fix Version/s: 3.1.0
                   3.0.0

> 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é
>             Fix For: 3.0.0, 3.1.0
>
>   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

       

[jira] Assigned: (KARAF-526) add-features-to-repo: descriptor with file contains spaces on unix

Posted by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-526?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Baptiste Onofré reassigned KARAF-526:
------------------------------------------

    Assignee: Jean-Baptiste Onofré

> 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

[jira] [Updated] (KARAF-526) add-features-to-repo: descriptor with file contains spaces on unix

Posted by "Andreas Pieber (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-526?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Pieber updated KARAF-526:
---------------------------------

    Fix Version/s: 3.0.1
    
> 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: karaf-feature, karaf-tooling
>    Affects Versions: 2.1.4
>         Environment: unix
>            Reporter: Alexey Markevich
>            Assignee: Jean-Baptiste Onofré
>             Fix For: 3.0.1, 3.1.0
>
>   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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (KARAF-526) add-features-to-repo: descriptor with file contains spaces on unix

Posted by "Alexey Markevich (JIRA)" <ji...@apache.org>.
    [ 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

[jira] [Updated] (KARAF-526) add-features-to-repo: descriptor with file contains spaces on unix

Posted by "Christian Schneider (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-526?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Schneider updated KARAF-526:
--------------------------------------

    Fix Version/s:     (was: 3.0.0)
    
> 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: karaf-feature, karaf-tooling
>    Affects Versions: 2.1.4
>         Environment: unix
>            Reporter: Alexey Markevich
>            Assignee: Jean-Baptiste Onofré
>             Fix For: 3.1.0
>
>   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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (KARAF-526) add-features-to-repo: descriptor with file contains spaces on unix

Posted by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13008480#comment-13008480 ] 

Jean-Baptiste Onofré commented on KARAF-526:
--------------------------------------------

I'm not sure that %20 works in the same way on Windows and Unix.
Maybe just an escape sequence is enough on Unix: replaceAll(" ", "\ ").

I'm trying like this.

> 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

[jira] [Updated] (KARAF-526) add-features-to-repo: descriptor with file contains spaces on unix

Posted by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-526?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Baptiste Onofré updated KARAF-526:
---------------------------------------

    Component/s: karaf-features

> 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: karaf-features, karaf-tooling
>    Affects Versions: 2.1.4
>         Environment: unix
>            Reporter: Alexey Markevich
>            Assignee: Jean-Baptiste Onofré
>             Fix For: 3.0.0, 3.1.0
>
>   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