Added support for all OSGi R4 framework manifest headers not already supported by POM configuration (FELIXM2-6)
o bundleCopyright
o bundleNativeCode
o bundleVersion
o bundleContactAddress
o bundleRequiredExecutionEnvironment
o bundleLocalization
o requireBundle
o fragmentHost
o bundleManifestVersion
git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@390787 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/tools/maven2/maven-osgi-plugin/src/main/java/org/apache/felix/tools/maven/plugin/OsgiManifest.java b/tools/maven2/maven-osgi-plugin/src/main/java/org/apache/felix/tools/maven/plugin/OsgiManifest.java
index c1ac712..a302909 100644
--- a/tools/maven2/maven-osgi-plugin/src/main/java/org/apache/felix/tools/maven/plugin/OsgiManifest.java
+++ b/tools/maven2/maven-osgi-plugin/src/main/java/org/apache/felix/tools/maven/plugin/OsgiManifest.java
@@ -17,10 +17,8 @@
package org.apache.felix.tools.maven.plugin;
-
import java.util.Properties;
-
/**
* Hold values for an OSGi jar "bundle" manifest.
*
@@ -29,128 +27,210 @@
*/
public class OsgiManifest
{
- private String bundleActivator;
- private String bundleName;
- private String bundleSource;
- private String bundleDescription;
- private String bundleVendor;
- private String bundleDate;
- private String bundleUpdateLocation;
- private String bundleSymbolicName;
- private String bundleDocUrl;
+ /**
+ * Bundle manifest header constants from the OSGi R4 framework constants.
+ */
+ private static final String BUNDLE_CATEGORY = "Bundle-Category";
+ // private static final String BUNDLE_CLASSPATH = "Bundle-ClassPath";
+ private static final String BUNDLE_COPYRIGHT = "Bundle-Copyright";
+ private static final String BUNDLE_DESCRIPTION = "Bundle-Description";
+ private static final String BUNDLE_NAME = "Bundle-Name";
+ private static final String BUNDLE_NATIVECODE = "Bundle-NativeCode";
+ private static final String EXPORT_PACKAGE = "Export-Package";
+ private static final String EXPORT_SERVICE = "Export-Service";
+ private static final String IMPORT_PACKAGE = "Import-Package";
+ private static final String DYNAMICIMPORT_PACKAGE = "DynamicImport-Package";
+ private static final String IMPORT_SERVICE = "Import-Service";
+ private static final String BUNDLE_VENDOR = "Bundle-Vendor";
+ private static final String BUNDLE_VERSION = "Bundle-Version";
+ private static final String BUNDLE_DOCURL = "Bundle-DocURL";
+ private static final String BUNDLE_CONTACTADDRESS = "Bundle-ContactAddress";
+ private static final String BUNDLE_ACTIVATOR = "Bundle-Activator";
+ private static final String BUNDLE_UPDATELOCATION = "Bundle-UpdateLocation";
+ private static final String BUNDLE_REQUIREDEXECUTIONENVIRONMENT = "Bundle-RequiredExecutionEnvironment";
+ private static final String BUNDLE_SYMBOLICNAME = "Bundle-SymbolicName";
+ private static final String BUNDLE_LOCALIZATION = "Bundle-Localization";
+ private static final String REQUIRE_BUNDLE = "Require-Bundle";
+ private static final String FRAGMENT_HOST = "Fragment-Host";
+ private static final String BUNDLE_MANIFESTVERSION = "Bundle-ManifestVersion";
+
+ private static final String BUNDLE_SOURCE = "Bundle-Source";
+ private static final String BUNDLE_DATE = "Bundle-Date";
+ private static final String METADATA_LOCATION = "Metadata-Location";
+
+ /**
+ * Instance variables corresponding to the R4 framework manifest headers
+ */
private String bundleCategory;
- private String importService;
- private String exportService;
+ // private String bundleClassPath;
+ private String bundleCopyright;
+ private String bundleDescription;
+ private String bundleName;
+ private String bundleNativeCode;
private String exportPackage;
+ private String exportService;
private String importPackage;
private String dynamicImportPackage;
- private String metadataLocation;
+ private String importService;
+ private String bundleVendor;
+ private String bundleVersion;
+ private String bundleDocUrl;
+ private String bundleContactAddress;
+ private String bundleActivator;
+ private String bundleUpdateLocation;
+ private String bundleRequiredExecutionEnvironment;
+ private String bundleSymbolicName;
+ private String bundleLocalization;
+ private String requireBundle;
+ private String fragmentHost;
+ private String bundleManifestVersion;
- // private String bundleClasspath;
+ /**
+ * Instance variables supporting non-framework manifest headers
+ */
+ private String bundleSource;
+ private String bundleDate;
+ private String metadataLocation;
private Properties entries = new Properties();
public Properties getEntries()
{
- if ( getBundleActivator() != null )
+ if ( getBundleCategory() != null )
{
- entries.put( "Bundle-Activator", getBundleActivator() );
+ entries.put( BUNDLE_CATEGORY, getBundleCategory() );
}
- if ( getBundleName() != null )
+ /*
+ if (getBundleClassPath() != null)
+ {
+ entries.put(BUNDLE_CLASSPATH, getBundleClassPath());
+ }
+ */
+
+ if ( getBundleCopyright() != null )
{
- entries.put( "Bundle-Name", getBundleName() );
+ entries.put( BUNDLE_COPYRIGHT, getBundleCopyright() );
}
if ( getBundleDescription() != null )
{
- entries.put( "Bundle-Description", getBundleDescription() );
+ entries.put( BUNDLE_DESCRIPTION, getBundleDescription() );
}
- if ( getBundleVendor() != null )
+ if ( getBundleName() != null )
{
- entries.put( "Bundle-Vendor", getBundleVendor() );
+ entries.put( BUNDLE_NAME, getBundleName() );
}
- if ( getExportService() != null )
+ if ( getBundleNativeCode() != null )
{
- entries.put( "Export-Service", getExportService() );
- }
-
- if ( getImportService() != null )
- {
- entries.put( "Import-Service", getImportService() );
+ entries.put( BUNDLE_NATIVECODE, getBundleNativeCode() );
}
if ( getExportPackage() != null )
{
- entries.put( "Export-Package", getExportPackage() );
+ entries.put( EXPORT_PACKAGE, getExportPackage() );
+ }
+
+ if ( getExportService() != null )
+ {
+ entries.put( EXPORT_SERVICE, getExportService() );
}
if ( getImportPackage() != null )
{
- entries.put( "Import-Package", getImportPackage() );
+ entries.put( IMPORT_PACKAGE, getImportPackage() );
}
if ( getDynamicImportPackage() != null )
{
- entries.put( "DynamicImport-Package", getDynamicImportPackage() );
+ entries.put( DYNAMICIMPORT_PACKAGE, getDynamicImportPackage() );
}
- /*
- if (getBundleClassPath() != null) {
- entries.put("Bundle-Classpath", getBundleClassPath());
- }
- */
-
- if ( getBundleDate() != null )
+ if ( getImportService() != null )
{
- entries.put( "Bundle-Date", getBundleDate() );
+ entries.put( IMPORT_SERVICE, getImportService() );
+ }
+
+ if ( getBundleVendor() != null )
+ {
+ entries.put( BUNDLE_VENDOR, getBundleVendor() );
+ }
+
+ if ( getBundleVersion() != null )
+ {
+ entries.put( BUNDLE_VERSION, getBundleVersion() );
+ }
+
+ if ( getBundleDocUrl() != null )
+ {
+ entries.put( BUNDLE_DOCURL, getBundleDocUrl() );
+ }
+
+ if ( getBundleContactAddress() != null )
+ {
+ entries.put( BUNDLE_CONTACTADDRESS, getBundleContactAddress() );
+ }
+
+ if ( getBundleActivator() != null )
+ {
+ entries.put( BUNDLE_ACTIVATOR, getBundleActivator() );
}
if ( getBundleUpdateLocation() != null )
{
- entries.put( "Bundle-UpdateLocation", getBundleUpdateLocation() );
+ entries.put( BUNDLE_UPDATELOCATION, getBundleUpdateLocation() );
+ }
+
+ if ( getBundleRequiredExecutionEnvironment() != null )
+ {
+ entries.put( BUNDLE_REQUIREDEXECUTIONENVIRONMENT, getBundleRequiredExecutionEnvironment() );
}
if ( getBundleSymbolicName() != null )
{
- entries.put( "Bundle-SymbolicName", getBundleSymbolicName() );
+ entries.put( BUNDLE_SYMBOLICNAME, getBundleSymbolicName() );
+ }
+
+ if ( getBundleLocalization() != null )
+ {
+ entries.put( BUNDLE_LOCALIZATION, getBundleLocalization() );
+ }
+
+ if ( getRequireBundle() != null )
+ {
+ entries.put( REQUIRE_BUNDLE, getRequireBundle() );
+ }
+
+ if ( getFragmentHost() != null )
+ {
+ entries.put( FRAGMENT_HOST, getFragmentHost() );
+ }
+
+ if ( getBundleManifestVersion() != null )
+ {
+ entries.put( BUNDLE_MANIFESTVERSION, getBundleManifestVersion() );
+ }
+
+ if ( getBundleSource() != null )
+ {
+ entries.put( BUNDLE_SOURCE, getBundleSource() );
+ }
+
+ if ( getBundleDate() != null )
+ {
+ entries.put( BUNDLE_DATE, getBundleDate() );
}
if ( getMetadataLocation() != null )
{
- entries.put( "Metadata-Location", getMetadataLocation() );
- }
-
- if ( getBundleCategory() != null )
- {
- entries.put( "Bundle-Category", getBundleCategory() );
- }
-
- if ( getBundleDocUrl() != null )
- {
- entries.put( "Bundle-DocUrl", getBundleDocUrl() );
- }
-
- if ( getBundleDocUrl() != null )
- {
- entries.put( "Bundle-Source", getBundleSource() );
+ entries.put( METADATA_LOCATION, getMetadataLocation() );
}
return entries;
}
- public String getBundleDocUrl()
- {
- return bundleDocUrl;
- }
-
- public void setBundleDocUrl( String bundleDocUrl )
- {
- this.bundleDocUrl = bundleDocUrl;
- }
-
public String getBundleCategory()
{
return bundleCategory;
@@ -161,24 +241,26 @@
this.bundleCategory = bundleCategory;
}
- public String getBundleActivator()
+ /*
+ public String getBundleClasspath()
+ {
+ return bundleClasspath;
+ }
+
+ public void setBundleClasspath(String bundleClasspath)
+ {
+ this.bundleClasspath = bundleClasspath;
+ }
+ */
+
+ public String getBundleCopyright()
{
- return bundleActivator;
+ return bundleCopyright;
}
- public void setBundleActivator( String bundleActivator )
+ public void setBundleCopyright( String bundleCopyright )
{
- this.bundleActivator = bundleActivator;
- }
-
- public String getBundleName()
- {
- return bundleName;
- }
-
- public void setBundleName( String bundleName )
- {
- this.bundleName = bundleName;
+ this.bundleCopyright = bundleCopyright;
}
public String getBundleDescription()
@@ -191,24 +273,24 @@
this.bundleDescription = bundleDescription;
}
- public String getBundleVendor()
+ public String getBundleName()
{
- return bundleVendor;
+ return bundleName;
}
- public void setBundleVendor( String bundleVendor )
+ public void setBundleName( String bundleName )
{
- this.bundleVendor = bundleVendor;
+ this.bundleName = bundleName;
}
- public String getExportService()
+ public String getBundleNativeCode()
{
- return exportService;
+ return bundleNativeCode;
}
- public void setExportService( String exportService )
+ public void setBundleNativeCode( String bundleNativeCode )
{
- this.exportService = exportService;
+ this.bundleNativeCode = bundleNativeCode;
}
public String getExportPackage()
@@ -221,6 +303,16 @@
this.exportPackage = exportPackage;
}
+ public String getExportService()
+ {
+ return exportService;
+ }
+
+ public void setExportService( String exportService )
+ {
+ this.exportService = exportService;
+ }
+
public String getImportPackage()
{
return importPackage;
@@ -236,29 +328,69 @@
return dynamicImportPackage;
}
- public void setDynamicImportPackage( String importPackage )
+ public void setDynamicImportPackage( String dynamicImportPackage )
{
- dynamicImportPackage = importPackage;
+ this.dynamicImportPackage = dynamicImportPackage;
}
- /*
- public String getBundleClasspath() {
- return bundleClasspath;
- }
-
- public void setBundleClasspath(String bundleClasspath) {
- this.bundleClasspath = bundleClasspath;
- }
- */
-
- public String getBundleDate()
+ public String getImportService()
{
- return bundleDate;
+ return importService;
}
- public void setBundleDate( String bundleDate )
+ public void setImportService( String importService )
{
- this.bundleDate = bundleDate;
+ this.importService = importService;
+ }
+
+ public String getBundleVendor()
+ {
+ return bundleVendor;
+ }
+
+ public void setBundleVendor( String bundleVendor )
+ {
+ this.bundleVendor = bundleVendor;
+ }
+
+ public String getBundleVersion()
+ {
+ return bundleVersion;
+ }
+
+ public void setBundleVersion( String bundleVersion )
+ {
+ this.bundleVersion = bundleVersion;
+ }
+
+ public String getBundleDocUrl()
+ {
+ return bundleDocUrl;
+ }
+
+ public void setBundleDocUrl( String bundleDocUrl )
+ {
+ this.bundleDocUrl = bundleDocUrl;
+ }
+
+ public String getBundleContactAddress()
+ {
+ return bundleContactAddress;
+ }
+
+ public void setBundleContactAddress( String bundleContactAddress )
+ {
+ this.bundleContactAddress = bundleContactAddress;
+ }
+
+ public String getBundleActivator()
+ {
+ return bundleActivator;
+ }
+
+ public void setBundleActivator( String bundleActivator )
+ {
+ this.bundleActivator = bundleActivator;
}
public String getBundleUpdateLocation()
@@ -271,6 +403,16 @@
this.bundleUpdateLocation = bundleUpdateLocation;
}
+ public String getBundleRequiredExecutionEnvironment()
+ {
+ return bundleRequiredExecutionEnvironment;
+ }
+
+ public void setBundleRequiredExecutionEnvironment( String bundleRequiredExecutionEnvironment )
+ {
+ this.bundleRequiredExecutionEnvironment = bundleRequiredExecutionEnvironment;
+ }
+
public String getBundleSymbolicName()
{
return bundleSymbolicName;
@@ -281,6 +423,66 @@
this.bundleSymbolicName = bundleSymbolicName;
}
+ public String getBundleLocalization()
+ {
+ return bundleLocalization;
+ }
+
+ public void setBundleLocalization( String bundleLocalization )
+ {
+ this.bundleLocalization = bundleLocalization;
+ }
+
+ public String getRequireBundle()
+ {
+ return requireBundle;
+ }
+
+ public void setRequireBundle( String requireBundle )
+ {
+ this.requireBundle = requireBundle;
+ }
+
+ public String getFragmentHost()
+ {
+ return fragmentHost;
+ }
+
+ public void setFragmentHost( String fragmentHost )
+ {
+ this.fragmentHost = fragmentHost;
+ }
+
+ public String getBundleManifestVersion()
+ {
+ return bundleManifestVersion;
+ }
+
+ public void setBundleManifestVersion( String bundleManifestVersion )
+ {
+ this.bundleManifestVersion = bundleManifestVersion;
+ }
+
+ public String getBundleSource()
+ {
+ return bundleSource;
+ }
+
+ public void setBundleSource( String bundleSource )
+ {
+ this.bundleSource = bundleSource;
+ }
+
+ public String getBundleDate()
+ {
+ return bundleDate;
+ }
+
+ public void setBundleDate( String bundleDate )
+ {
+ this.bundleDate = bundleDate;
+ }
+
public String getMetadataLocation()
{
return metadataLocation;
@@ -290,24 +492,4 @@
{
this.metadataLocation = metadataLocation;
}
-
- public void setBundleSource( String bundleSource )
- {
- this.bundleSource = bundleSource;
- }
-
- public String getBundleSource()
- {
- return bundleSource;
- }
-
- public void setImportService( String importService )
- {
- this.importService = importService;
- }
-
- public String getImportService()
- {
- return importService;
- }
}