com.sun.enterprise.module.maven
Class OSGiPackager

java.lang.Object
  extended by com.sun.enterprise.module.maven.OSGiPackager

public class OSGiPackager
extends Object

Prepares OSGi manifest entries in MavenArchiveConfiguration.

Author:
Sanjeeb.Sahoo@Sun.COM

Constructor Summary
OSGiPackager(Properties props)
           
 
Method Summary
 Map<String,String> configureOSGiManifest(org.apache.maven.project.MavenProject pom, org.apache.maven.archiver.MavenArchiveConfiguration archive, File classesDirectory)
          Reads information from the POM and the artifact archive to configure the OSGi manifest entries.
static List<com.sun.enterprise.module.maven.OSGiPackager.ExportedPackage> discoverPackages(File classesDirectory)
           
 List<com.sun.enterprise.module.maven.OSGiPackager.BundleDependency> discoverRequiredBundles(org.apache.maven.project.MavenProject pom)
           
static String generateExportPackageHeader(Collection<com.sun.enterprise.module.maven.OSGiPackager.ExportedPackage> packages, String version)
           
 String generateRequireBundleHeader(List<com.sun.enterprise.module.maven.OSGiPackager.BundleDependency> dependencies)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OSGiPackager

public OSGiPackager(Properties props)
Method Detail

configureOSGiManifest

public Map<String,String> configureOSGiManifest(org.apache.maven.project.MavenProject pom,
                                                org.apache.maven.archiver.MavenArchiveConfiguration archive,
                                                File classesDirectory)
                                         throws IOException
Reads information from the POM and the artifact archive to configure the OSGi manifest entries. Returns a new set of entries if the archive does not already have manifest entries, else it uses the existing entries map. If any of the attribute already exists, then it skips its processing honoring user's request. It uses the following rules: Bundle-SymbolicName is assumed to be "${groupId}.${artifactId}" Bundle-Version is derived from "${pom.version}" using VersionTranslator.MavenToOSGi(String) Bundle-Description is assumed to be "${pom.description}". Bundle-Vendor is assumed to be "${pom.organization.name}". Require-Bundle is populated by values read from pom dependencies Note: There is no support for Export-Package yet. It sets Bundle-ManifestVersion as 2 which indicates OSGi r4 bundle.

Parameters:
pom - The Maven project object
archive - The archive that is being built
classesDirectory - output for javac
Returns:
Manifest entries
Throws:
IOException

discoverRequiredBundles

public List<com.sun.enterprise.module.maven.OSGiPackager.BundleDependency> discoverRequiredBundles(org.apache.maven.project.MavenProject pom)
                                                                                            throws IOException
Throws:
IOException

generateRequireBundleHeader

public String generateRequireBundleHeader(List<com.sun.enterprise.module.maven.OSGiPackager.BundleDependency> dependencies)

discoverPackages

public static List<com.sun.enterprise.module.maven.OSGiPackager.ExportedPackage> discoverPackages(File classesDirectory)

generateExportPackageHeader

public static String generateExportPackageHeader(Collection<com.sun.enterprise.module.maven.OSGiPackager.ExportedPackage> packages,
                                                 String version)


Copyright © 2013 Oracle Corporation. All Rights Reserved.