pax-wrap-jar [-g groupId] -a artifactId [-v version] [-c classifier] [-o] [-- mvnOpts ...]

Creates a Maven POM to wrap a third-party jar as an OSGi bundle, use -o to overwrite an existing wrapper. When this script is used outside of a Pax-Construct project, it creates a standalone POM.

  • if no groupId is given, it is assumed to be the same as the artifactId.
  • if no version is given, the latest version in the repository is selected.

Additional Maven options

-DaddVersionadd the library version to the wrapper directory
-DwrapTransitivecreate wrappers for transitive dependencies
-DwrapOptionalalso create wrappers for optional dependencies
-Dexclusions=groupId:artifactId,...exclude these artifacts from being wrapped
-DembedTransitiveembed transitive dependencies inside the wrapper
-DincludeResource=directiveInclude-Resource BND directive
-DimportPackage=directiveImport-Package BND directive
-DexportContents=directive-exportcontents BND directive
-DrequireBundle=directiveRequire-Bundle BND directive
-DdynamicImport=directiveDynamicImport-Package BND directive
-DnoUsesdon't add any "uses:=" to the generated exports
-DtestMetadata=falsedisable exhaustive OSGi bundle detection
-DbundleName=nameprovide a customized name to the new bundle
-DbundleGroupId=groupIdprovide a customized groupId to the new bundle
-DbundleVersion=versionprovide a customized version to the new bundle
-DparentId=groupId:artifactIdlook for a different parent POM
-DtargetDirectory=pathalternative location of the wrapper
-Dcontents=groupId:artifactId:version,...include content from selected archetypes
-DremoteRepositories=url listwhere to download the wrapper archetype(s)
-DarchetypeVersion=versionuse a different release of the Pax archetype
-DattachPom=falsedon't add this wrapper as a module
-DcompactIds=falsedon't try to combine name segments

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

Examples

pax-wrap-jar -a backport-util-concurrent -v 3.0 -- -DaddVersion "-DimportPackage=sun.misc;resolution:=optional,*"

pax-wrap-jar -a commons-logging -v 1.1 -- -DwrapTransitive "-DimportPackage=javax.*|com.sun.jdmk.comm;resolution:=optional,*"

pax-wrap-jar -g org.testng -a testng -c jdk15