[
https://issues.apache.org/jira/browse/KARAF-3727?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jean-Baptiste Onofré updated KARAF-3727:
----------------------------------------
Fix Version/s: (was: cave-4.0.0)
> Cave generate the repository.xml with "bad" path on Windows
> -----------------------------------------------------------
>
> Key: KARAF-3727
> URL: https://issues.apache.org/jira/browse/KARAF-3727
> Project: Karaf
> Issue Type: Bug
> Components: cave-repository
> Affects Versions: cave-2.3.0, cave-3.0.0
> Reporter: Jean-Baptiste Onofré
> Assignee: Jean-Baptiste Onofré
> Fix For: cave-2.3.1, cave-3.0.1
>
>
> On Windows, when using cave:repository-update nice-repo, the generated
> repository.xml contains bad paths:
> {code}
> <repository name="test-repo" lastmodified="20150512044028.680">
> <resource id="org.apache.felix.ipojo/1.8.0"
> symbolicname="org.apache.felix.ipojo"
> presentationname="Apache Felix iPOJO"
> uri="file:/C:/foo/bar/apache-karaf-3.0.2/foo/bundle_repo/test-repo/org/apache/felix/org.apache.felix.ipojo/1.8.0/org.apache.felix.ipojo-1.8.0.jar"
>
> version="1.8.0">
> {code}
> Especially, the slashes are not good on Windows.
> The issue is that, in the CaveRepositoryImpl, we do:
> {code}
> private void useResourceRelativeUri(ResourceImpl resource) throws Exception {
> String resourceURI = resource.getURI();
> String locationURI = "file:" + this.getLocation();
> LOGGER.debug("Converting resource URI {} relatively to repository URI
> {}", resourceURI, locationURI);
> if (resourceURI.startsWith(locationURI)) {
> resourceURI = resourceURI.substring(locationURI.length() + 1);
> LOGGER.debug("Resource URI converted to " + resourceURI);
> resource.put(Resource.URI, resourceURI);
> }
> }
> {code}
> The problem is that, if the resourceURI looks good (using back slashes), the
> locationURI uses forward slashes. So the method doesn't trim the URI for the
> repository.xml and it ends with the full path (instead of the relative one).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)