4. Usage

4.1 Command-Line Usage

The command line client allows Bundlor to be run from the command line of any platform

4.1.1 Command Syntax

To use Bundlor run the following for UNIX and Windows respectively.

$BUNDLOR_HOME/bin/bundlor.sh [options] 
%BUNDLOR_HOME%\bin\bundlor.bat [options] 

4.1.2 Command Line Reference

4.1.2.1 Command Line Parameters

The following table lists all the parameters that you can specify for the bundlor command line client.

Table 4.1. Attributes

AttributeDescriptionRequired
-f Whether Bundlor should cause a build failure when there are warnings warnings about the resulting manifest No - defaults to false
-i <path> The path to the input to create a manifest for. This can either be a directory or a JAR file. Yes
-m <path> The path to the manifest template. See Chapter 5, Manifest Templates for details. No
-p <path> The path to the OSGi profile. See Chapter 6, OSGI Profiles and Bundlor for details. No
-o <path>

The path to write the manifest to. This can either be a directory, a JAR file, or not specified.

If a directory is specified, the manifest will be written to ${directory}/META-INF/MANIFEST.MF.

If a JAR file is specified, the manifest will be written as the manifest for that JAR file.

If nothing is specified, the manifest will be written to System.out.

No - defaults to System.out
-r <path> The path to a properties file used for substitution. See Section 5.3, “Specifying property placeholders” for details. No

4.1.2.2 Command Line Property Values

Property substitution values can be optionally specified on the command line instead of as an external file using the -Dproperty=value parameter.

% ./bundlor.sh \
-i ./org.springframework.integration.jar \
-m ./template.mf \
-o ./target/org.springframework.integration.jar \
-Dname="Spring Integration"

Transformed bundle written to ./target/org.springframework.integration.jar
%

See Section 5.3, “Specifying property placeholders” for details.

4.1.3 ANT Task Examples

4.1.3.1 Creating a manifest

% ./bundlor.sh \
-i ./org.springframework.integration.jar \
-m ./template.mf \
-o ./target/org.springframework.integration.jar

Transformed bundle written to ./target/org.springframework.integration.jar
%

4.1.3.2 Creating a manifest with placeholder replacement

% ./bundlor.sh \
-i ./org.springframework.integration.jar \
-m ./template.mf \
-o ./target/org.springframework.integration.jar \
-Dname="Spring Integration"

Transformed bundle written to ./target/org.springframework.integration.jar
%