Upgrading the Liferay Maven Build

If you’re an avid Maven user and have been using it for Liferay Portal 6.2 project development, you must upgrade your Maven build to be compatible with Liferay Portal CE 7.0 development. There are two main parts of the Maven environment upgrade process that you must address:

  • Upgrading to new Liferay Portal CE 7.0 Maven plugins
  • Updating Liferay Maven artifact dependencies

For more information on using Maven with Liferay Portal CE 7.0, see the Maven tutorial section. For a guided and expedited upgrade process for your Maven build, try the Code Upgrade Tool.

You’ll start off by upgrading your Maven environment’s Liferay Maven plugins.

Upgrading to New Liferay Portal CE 7.0 Maven Plugins

The biggest change for your project’s build plugins is the removal of the liferay-maven-plugin. Liferay now provides several individual Maven plugins that accomplish specific tasks. For example, you can configure Maven plugins for Liferay’s CSS Builder, Service Builder, Theme Builder, etc. With smaller plugins available to accomplish specific tasks in your project, you no longer have to rely on one large plugin that provides many things you may not want.

For example, suppose your Liferay Portal 6.2 project was using the liferay-maven-plugin for Liferay CSS Builder only. First, you should remove the legacy liferay-maven-plugin plugin dependency from your project’s pom.xml file:


Then, add the CSS Builder plugin dependency to your project’s pom.xml file:


Some common Liferay Maven plugins are listed below, with their corresponding artifact IDs and tutorials explaining how to configure them:

Common Liferay Maven Plugins

Name Artifact ID Tutorial
CSS Builder com.liferay.css.builder Compiling SASS Files in a Maven Project
Lang Builder com.liferay.lang.builder Coming Soon
Service Builder com.liferay.portal.tools.service.builder Using Service Builder in a Maven Project
Theme Builder com.liferay.portal.tools.theme.builder Building Themes in a Maven Project

In Liferay Portal 6.2, you were also required to specify all your app server configuration settings. For example, your parent POM probably contained settings similar to these:








This is no longer required in Liferay Portal CE 7.0 because Liferay’s Maven tools no longer rely on your Liferay Portal installation’s specific versions. You should remove them from your POM file.

Awesome! You’ve learned about the new Maven plugins available to you for Liferay Portal CE 7.0 development. Next, you’ll learn about updating your Liferay Maven artifacts.

Updating Liferay Maven Artifact Dependencies

Many Liferay Portal 6.2 artifact dependencies you were using have changed in Liferay Portal CE 7.0. See the table below for popular Liferay Maven artifacts that have changed:

Liferay Portal 6.2 Artifact ID Liferay Portal CE 7.0 Artifact ID
portal-service com.liferay.portal.kernel
util-bridges com.liferay.util.bridges
util-java com.liferay.util.java
util-slf4j com.liferay.util.slf4j
util-taglib com.liferay.util.taglib

For more information on resolving dependencies in Liferay Portal CE 7.0, see the Resolving a Plugin’s Dependencies tutorial.

Of course, you must also update the artifacts you’re referencing for your projects. If you’re using the Central Repository to install Liferay Maven artifacts, you won’t need to do anything more than update the artifacts in your POMs. If, however, you’re working behind a proxy or don’t have Internet access, you must update your company-shared or local repository with the latest Liferay Portal CE 7.0 Maven artifacts. See the Installing Liferay Maven Artifacts tutorial for instructions.

With these updates, you can easily upgrade your Liferay Maven build so you can begin developing traditional plugin projects for Liferay Portal CE 7.0.

0 (0 Votes)
Resolving a Plugin’s Dependencies Previous