Author: mcculls
Date: Thu Aug 23 02:41:08 2007
New Revision: 568907
URL: http://svn.apache.org/viewvc?rev=568907&view=rev
Log:
FELIX-343: replace any instances of {maven-resources} in Include-Resource with
the actual project's resource paths
Modified:
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
Modified:
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
URL:
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java?rev=568907&r1=568906&r2=568907&view=diff
==============================================================================
---
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
(original)
+++
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
Thu Aug 23 02:41:08 2007
@@ -110,6 +110,11 @@
*/
private Maven2OsgiConverter maven2OsgiConverter;
+
+ private static final String MAVEN_RESOURCES = "{maven-resources}";
+ private static final String MAVEN_RESOURCES_REGEX =
"\\{maven-resources\\}";
+
+
protected Maven2OsgiConverter getMaven2OsgiConverter()
{
return this.maven2OsgiConverter;
@@ -209,8 +214,18 @@
final String includeResource =
(String)properties.get(Analyzer.INCLUDE_RESOURCE);
if (includeResource != null)
{
- this.getLog().warn(Analyzer.INCLUDE_RESOURCE + ":
overriding " + mavenResourcePaths + " with " + includeResource );
- } else
+ if (includeResource.indexOf(MAVEN_RESOURCES) >= 0)
+ {
+ String combinedResource =
includeResource.replaceAll(MAVEN_RESOURCES_REGEX, mavenResourcePaths);
+ properties.put(Analyzer.INCLUDE_RESOURCE,
combinedResource);
+ }
+ else
+ {
+ this.getLog().warn(Analyzer.INCLUDE_RESOURCE + ":
overriding " + mavenResourcePaths + " with " +
+ includeResource + " (add " + MAVEN_RESOURCES + "
if you want to include the maven resources)");
+ }
+ }
+ else
{
properties.put(Analyzer.INCLUDE_RESOURCE,
mavenResourcePaths);
}