Bundle Support Plugin

The Bundle Support plugin lets you use Liferay Workspace as a Maven project. For more information on how a Maven Workspace works and the features it provides, see the Maven Workspace tutorial.

Usage

To use the plugin, include it in your project’s root pom.xml file:

<build>
    <plugins>
    ...
        <plugin>
            <groupId>com.liferay</groupId>
            <artifactId>com.liferay.portal.tools.bundle.support</artifactId>
            <version>3.2.5</version>
            <executions>
                <execution>
                    <id>clean</id>
                    <goals>
                        <goal>clean</goal>
                    </goals>
                    <phase>clean</phase>
                    <configuration>
                    </configuration>
                </execution>
                <execution>
                    <id>deploy</id>
                    <goals>
                        <goal>deploy</goal>
                    </goals>
                    <phase>pre-integration-test</phase>
                    <configuration>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        ...
    </plugins>
</build>

Goals

The plugin adds five Maven goals to your project:

NameDescription
bundle-support:cleanDeletes a file from the deploy directory of a Liferay bundle.
bundle-support:create-tokenCreates a token used to validate your user credentials when downloading a DXP bundle.
bundle-support:deployDeploys the Maven project to the specified Liferay DXP bundle.
bundle-support:distCreates a distributable Liferay DXP bundle archive file (e.g., ZIP).
bundle-support:initDownloads and installs the specified Liferay DXP version.

clean Goal’s Available Parameters

You can set the following parameters in the clean execution’s <configuration> section of the POM:

Parameter NameTypeDefault ValueDescription
liferayHomeStringbundlesThe directory where your Liferay DXP instance resides. This can be specified from the command line as -DliferayHome=.
fileNameString${project.artifactId}.${project.packaging}The name of the file to delete from your bundle.

create-token Goal’s Available Parameters

You can change the default parameter values of the create-token goal by creating an <execution> section containing <configuration> tags. For example,

<execution>
    <id>create-token</id>
    <goals>
        <goal>create-token</goal>
    </goals>
    <configuration>
    </configuration>
</execution>

You can set the following parameters in the create-token execution’s <configuration> section of the POM:

Parameter NameTypeDefault ValueDescription
emailAddressStringnullThe email address to use when downloading a DXP bundle. This email address must match the one registered for your DXP subscription.
forcebooleanfalseWhether to override the existing token with a newly generated one.
passwordStringnullThe password to use when downloading a DXP bundle. This password must match the one registered for your DXP subscription.
passwordFileFilenullThe file to hold your password used when downloading a DXP bundle.
tokenFileFile${user.home}/.liferay/tokenThe file to hold the Liferay bundle authentication token.
tokenUrlURLhttps://releases-cdn.liferay.com/portal/7.1.0-b3/liferay-ce-portal-tomcat-7.1-b3-20180611140920623.zipThe URL pointing to the bundle Zip to download.

After executing the create-token goal, you’re prompted for your email address and password, both of which are used to generate your token. It’s recommended to configure your email and password from the command line rather than specifying them in your POM file.

deploy Goal’s Available Parameters

You can set the following parameters in the deploy execution’s <configuration> section of the POM:

Parameter NameTypeDefault ValueDescription
liferayHomeStringbundlesThe directory where your Liferay DXP instance resides. This can be specified from the command line as -DliferayHome=.
deployFileFile${project.build.directory}/${project.build.finalName}.${project.packaging}The packaged file (e.g., JAR) to deploy to the Liferay bundle.
outputFileNameString${project.artifactId}.${project.packaging}The name of the output file.

dist Goal’s Available Parameters

You can change the default parameter values of the dist goal by creating an <execution> section containing <configuration> tags. For example,

<execution>
    <id>dist</id>
    <goals>
        <goal>dist</goal>
    </goals>
    <configuration>
    </configuration>
</execution>

You can set the following parameters in the dist execution’s <configuration> section of the POM:

Parameter NameTypeDefault ValueDescription
liferayHomeStringbundlesThe directory where your Liferay DXP instance resides. This can be specified from the command line as -DliferayHome=.
archiveFileNameStringnullThe name for the generated archive file.
cacheDirFile${user.home}/.liferay/bundlesThe directory where the downloaded bundle Zip files are stored.
configsStringconfigsThe directory that contains the configuration files.
deployFileFile${project.build.directory}/${project.build.finalName}.${project.packaging}The packaged file (e.g., JAR) to deploy to the Liferay bundle.
environmentString${liferay.workspace.environment}The environment of your Liferay home deployment. (e.g., common, dev, local, prod, and uat).
formatStringzipThe format type to use when packaging the Liferay bundle as an archive.
includeFolderbooleantrueWhether to add a parent folder to the archive.
outputFileNameString${project.artifactId}.${project.packaging}The path to the archive file.
passwordStringnullThe password if your Liferay bundle’s URL requires authentication.
stripComponentsint1The number of directories to strip when expanding your bundle.
tokenbooleanfalseWhether to use a token to download a Liferay DXP bundle. This should be set to true when downloading a DXP bundle.
tokenFileFile${user.home}/.liferay/tokenThe file to hold the Liferay bundle authentication token.
urlURL${liferay.workspace.bundle.url}The URL of the Liferay bundle to expand.
userNameStringnullThe user name if your Liferay bundle’s URL requires authentication.

init Goal’s Available Parameters

You can change the default parameter values of the init goal by creating an <execution> section containing <configuration> tags. For example,

<execution>
    <id>init</id>
    <goals>
        <goal>init</goal>
    </goals>
    <configuration>
    </configuration>
</execution>

You can set the following parameters in the init execution’s <configuration> section of the POM:

Parameter NameTypeDefault ValueDescription
liferayHomeStringbundlesThe directory where your Liferay DXP instance resides. This can be specified from the command line as -DliferayHome=.
cacheDirFile${user.home}/.liferay/bundlesThe directory where the downloaded bundle Zip files are stored.
configsStringconfigsThe directory that contains the configuration files.
environmentString${liferay.workspace.environment}The environment with the settings appropriate for current development (e.g., common, dev, local, prod, and uat).
passwordStringnullThe password if your Liferay bundle’s URL requires authentication.
stripComponentsint1The number of directories to strip when expanding your bundle.
tokenbooleanfalseWhether to use a token to download a Liferay DXP bundle. This should be set to true when downloading a DXP bundle.
tokenFileFile${user.home}/.liferay/tokenThe file to hold the Liferay bundle authentication token.
urlURL${liferay.workspace.bundle.url}The URL of the Liferay bundle to expand.
userNameStringnullThe user name if your Liferay bundle’s URL requires authentication.
« Introduction to MavenCSS Builder Plugin »
Was this article helpful?
0 out of 0 found this helpful