FELIX-5030: check pom file exists before adding it to bundle
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1703863 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
index 1937cbb..d374574 100644
--- a/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ b/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -1262,8 +1262,16 @@
private void doMavenMetadata( MavenProject currentProject, Jar jar ) throws IOException
{
String path = "META-INF/maven/" + currentProject.getGroupId() + "/" + currentProject.getArtifactId();
- File pomFile = new File( currentProject.getBasedir(), "pom.xml" );
- jar.putResource( path + "/pom.xml", new FileResource( pomFile ) );
+
+ File pomFile = currentProject.getFile();
+ if ( pomFile == null || !pomFile.exists() )
+ {
+ pomFile = new File( currentProject.getBasedir(), "pom.xml" );
+ }
+ if ( pomFile.exists() )
+ {
+ jar.putResource( path + "/pom.xml", new FileResource( pomFile ) );
+ }
Properties p = new Properties();
p.put( "version", currentProject.getVersion() );