in src/main/java/org/apache/sling/maven/bundlesupport/FsMountMojo.java [269:302]
private void deployBundle(CloseableHttpClient httpClient, Bundle bundle, URI consoleTargetUrl)
throws MojoExecutionException {
try {
if (isBundleInstalled(httpClient, bundle, consoleTargetUrl)) {
getLog().debug("Bundle " + bundle.getSymbolicName() + " " + bundle.getOsgiVersion()
+ " (or higher) already installed.");
return;
}
} catch (IOException e) {
throw new MojoExecutionException(
"Error getting installation status of " + bundle + " via " + consoleTargetUrl + ": "
+ e.getMessage(),
e);
}
try {
getLog().info("Installing Bundle " + bundle.getSymbolicName() + " " + bundle.getOsgiVersion() + " to "
+ consoleTargetUrl + " via " + deploymentMethod);
File file = getArtifactFile(bundle, "jar");
deploymentMethod
.execute()
.deploy(
getTargetURL(),
file,
bundle.getSymbolicName(),
new DeployContext()
.log(getLog())
.httpClient(httpClient)
.failOnError(failOnError));
} catch (IOException e) {
throw new MojoExecutionException(
"Error deploying bundle " + bundle + " to " + getTargetURL() + ": " + e.getMessage(), e);
}
}