Fix issue Felix-1054.
When deploying a bundle, the computed uri is printed on the console:
[INFO] Computed bundle uri: http://repo1.maven.org/maven2/org/apache/felix/org.apache.felix.log/1.0.0/org.apache.felix.log-1.0.0.jar
This allows the user to check if the URL prefix was used correctly.
This is done for the deploy and deploy-file goal.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@767966 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java
index 14b426d..81ec876 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java
@@ -231,7 +231,9 @@
if ( bundleUrl != null )
{
// public URL differs from the bundle file location
- userConfig.setRemoteBundle( URI.create( bundleUrl ) );
+ URI uri = URI.create( bundleUrl );
+ log.info("Computed bundle uri: " + uri);
+ userConfig.setRemoteBundle( uri );
}
else if ( prefixUrl != null )
{
@@ -240,7 +242,9 @@
String relative = ObrUtils.getRelativeURI( ObrUtils.toFileURI( mavenRepository ), bundleJar )
.toASCIIString();
URL resourceURL = new URL( new URL( prefixUrl + '/' ), relative );
- userConfig.setRemoteBundle( URI.create( resourceURL.toString() ) );
+ URI uri = URI.create( resourceURL.toString() );
+ log.info("Computed bundle uri: " + uri);
+ userConfig.setRemoteBundle( uri );
}
update = new ObrUpdate( repositoryXml, obrXmlFile, project, mavenRepository, userConfig, log );
diff --git a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeployFile.java b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeployFile.java
index c7bb273..2dc8f55 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeployFile.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeployFile.java
@@ -186,12 +186,16 @@
if ( null != bundleUrl )
{
// public URL differs from the bundle file location
- userConfig.setRemoteBundle( URI.create( bundleUrl ) );
+ URI uri = URI.create( bundleUrl );
+ log.info("Computed bundle uri: " + uri);
+ userConfig.setRemoteBundle( uri );
}
else if ( null != file )
{
// assume file will be deployed in remote repository, so find the remote relative location
- userConfig.setRemoteBundle( URI.create( localRepository.pathOf( project.getArtifact() ) ) );
+ URI uri = URI.create( localRepository.pathOf( project.getArtifact() ) );
+ log.info("Computed bundle uri: " + uri);
+ userConfig.setRemoteBundle( uri );
}
update = new ObrUpdate( repositoryXml, obrXmlFile, project, mavenRepository, userConfig, log );