pax-create-bundle -p package [-n bundleName] [-v version] [-o] [-- mvnOpts ...]

Creates a Maven POM and example source to build a working OSGi bundle, use -o to overwrite an existing bundle. When this script is used outside of a Pax-Construct project, it creates a standalone POM.

  • if no bundleName is given, it is assumed to be the same as the package.
  • if no version is given, it is assumed to be 1.0-SNAPSHOT.

Additional Maven options

-Dinterface=falseremove all public (exported) APIs
-Dinternals=falseremove all internal (private) code
-Dactivator=falseremove any bundle activators
-Djunit or -Djunit=versionadd test dependencies and example tests
-Dspring or -Dspring=versionadd example Spring Dynamic Modules bean + XML
-DnoDepsdon't add any additional dependencies
-DbundleGroupId=groupIdprovide a customized groupId to the new bundle
-DparentId=groupId:artifactIdlook for a different parent POM
-DtargetDirectory=pathalternative location of the bundle
-Dcontents=groupId:artifactId:version,...include content from selected archetypes
-DremoteRepositories=url listwhere to download the bundle archetype(s)
-DarchetypeVersion=versionuse a different release of the Pax archetype
-DattachPom=falsedon't add this bundle as a module
-DcompactIds=falsedon't try to combine name segments

-DparentId is useful when you want to link the new bundle into an existing non Pax-Construct project.

Examples

pax-create-bundle -n simple-api -p org.example.simple -- "-Dinternals=false"

pax-create-bundle -n simple-impl -p org.example.simple -- "-Dinterface=false"