Manage boot classpath
Manage boot classpath
By default the only library available in the boot classpath is the Framework jar. If your usage require that additional entries should be available in the boot (system) classpath, you can specify that in two ways:
By adding extra libraries to boot classpath, the options --bootDelegation
and --systemPackages
can now be set to delegate and/or export packages from this additional libraries.
Managed boot classpath libraries
Pax Runner can manage the availability of libraries in boot classpath via the --bcp
options. This means that you can specify one or more jar files (as URL) in the command line and Pax Runner will download them into the local cache (under the same conditions as for any other provisioned bundles) and it will setup the java boot classpath option prior launching the framework runtime.
The value of --bcp/p
or --bcp/a
option should be a valid url of the required library. The url can be any of the "standard" supported urls or the additional ones supported by Pax Runner such as mvn:, wrap:, obr:, ...
In order to control the order of the classpath (ordr of jar files), one can use the /p or /a option flavor. By using --bcp/p
the jar will be setup before the framework jar, when using --bcp/a
, the jar will setup after the framework jar. This options can be specified as many times as needed. In case of more then one --bcp
option is specified, the jars will be ordered in the order of declaration.
Example
The following is an virtual example: Lets say that we need to have in the boot classpath 3 jars, a.jar, b.jar and c.jar. where the a and b jars should prepend the framework jar and c should follow it.
pax-run --bcp/p=mvn:foo/a/1.0 --bcp/p=mvn:foo/b --bcp/a=file:/lib/c.jar
This will make Pax Runner download the jars in the cache and setup a boot classpath as a.jar:b.jar:<framework jar>:c.jar
.
Unmanaged boot classpath entries
If you do not want to let Pax Runner manage your bootclasspath you can use the --classpath
option to specify the classpath entries.
pax-run --classpath=<entries>
where entries is a File.pathSeparator
separated list of classpath entries to be appended to the framework classpath which consists out of the framework system jar.
You can use --cp
as an alias for --classpath
Example
pax-run --classpath=a.jar:b.jar
This will make Pax Runner to setup a boot classpath as <framework jar>:a.jar:b.jar
.