FELIX-1836: check output directory for filtered obr.xml before checking resource directories
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1140386 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 5e3df4c..258e470 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java
@@ -224,7 +224,7 @@
String mavenRepository = localRepository.getBasedir();
URI repositoryXml = downloadedRepositoryXml.toURI();
- URI obrXmlFile = ObrUtils.findObrXml( project.getResources() );
+ URI obrXmlFile = ObrUtils.findObrXml( project );
Config userConfig = new Config();
userConfig.setRemoteFile( true );
diff --git a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstall.java b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstall.java
index 60654ed..24fe99a 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstall.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstall.java
@@ -133,7 +133,7 @@
String mavenRepository = localRepository.getBasedir();
URI repositoryXml = ObrUtils.findRepositoryXml( mavenRepository, obrRepository );
- URI obrXmlFile = ObrUtils.findObrXml( project.getResources() );
+ URI obrXmlFile = ObrUtils.findObrXml( project );
Config userConfig = new Config();
diff --git a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrUtils.java b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrUtils.java
index 081de24..84b39aa 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrUtils.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrUtils.java
@@ -28,6 +28,7 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.model.Resource;
+import org.apache.maven.project.MavenProject;
/**
@@ -85,15 +86,20 @@
/**
- * @param resources collection of resource locations
+ * @param project current project
* @return URI pointing to correct obr.xml, null if not found
*/
- public static URI findObrXml( Collection resources )
+ public static URI findObrXml( MavenProject project )
{
- for ( Iterator i = resources.iterator(); i.hasNext(); )
+ File obrFile = new File( project.getBuild().getOutputDirectory(), OBR_XML );
+ if ( obrFile.exists() )
+ {
+ return obrFile.toURI();
+ }
+ for ( Iterator i = project.getResources().iterator(); i.hasNext(); )
{
Resource resource = ( Resource ) i.next();
- File obrFile = new File( resource.getDirectory(), OBR_XML );
+ obrFile = new File( resource.getDirectory(), OBR_XML );
if ( obrFile.exists() )
{
return obrFile.toURI();