Ensure any future OBR issues don't break the bundle life-cycle
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@579981 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/OBRInstall.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/OBRInstall.java
index cd32cb8..7440578 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/OBRInstall.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/OBRInstall.java
@@ -78,21 +78,29 @@
}
Log log = getLog();
+ ObrUpdate update;
- String localRepoPath = localRepository.getBasedir();
- String artifactPath = localRepository.pathOf( project.getArtifact() );
- String bundlePath = localRepoPath + File.separator + artifactPath;
- bundlePath = bundlePath.replace( '\\', '/' );
+ try
+ {
+ String localRepoPath = localRepository.getBasedir();
+ String artifactPath = localRepository.pathOf( project.getArtifact() );
+ String bundlePath = localRepoPath + File.separator + artifactPath;
+ bundlePath = bundlePath.replace( '\\', '/' );
- PathFile repositoryXml = normalizeRepositoryPath( obrRepository, localRepoPath );
- String extensionXml = findOBRExtensions( project.getResources() );
+ PathFile repositoryXml = normalizeRepositoryPath( obrRepository, localRepoPath );
+ String extensionXml = findOBRExtensions( project.getResources() );
- Config user = new Config();
+ Config user = new Config();
- ObrUpdate update = new ObrUpdate( repositoryXml, extensionXml, project, bundlePath, localRepoPath, user, log );
+ update = new ObrUpdate( repositoryXml, extensionXml, project, bundlePath, localRepoPath, user, log );
- repositoryXml.createPath();
- update.updateRepository();
+ repositoryXml.createPath();
+ update.updateRepository();
+ }
+ catch( Exception e )
+ {
+ log.warn( "Exception while updating OBR: " + e.getLocalizedMessage(), e );
+ }
}
private static PathFile normalizeRepositoryPath( String obrPath, String mavenPath )