« Back

Liferay Maven Support in Liferay 6.1 GA3

Company Blogs June 18, 2013 By Mika Koivisto Staff

We've finally released both CE and EE versions of Liferay 6.1 GA3 and along with those releases we've also released the corresponding versions of Liferay Maven Support and Portal artifacts. The version numbers are 6.1.2 for CE GA3 and 6.1.30 for EE GA3. With this release there is one significant improvement in the Liferay Maven Plugin and that is they are no longer directly dependent on a Liferay Portal version. We could have just released one version and it would have worked with either portal version, in fact they both work with any portal version starting from 6.1.0. In the future we will probably move to a single release of Liferay Maven Support which will eventually have it's own release cycle completely independent of the portals release cycle.  

All the archetypes will now have a separate property for Liferay Maven Plugin version called liferay.maven.plugin.version. The plugin will also now require you to tell which portal version you are developing against and you'll do that by providing it liferayVersion in the configuration section. Here's a example from liferay-theme-archetype:

  
<plugin>
  <groupId>com.liferay.maven.plugins</groupId>
  <artifactId>liferay-maven-plugin</artifactId>
  <version>${liferay.maven.plugin.version}</version>
  <executions>
    <execution>
      <phase>generate-sources</phase>
      <goals>
        <goal>theme-merge</goal>
        <goal>build-css</goal>
        <goal>build-thumbnail</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <autoDeployDir>${liferay.auto.deploy.dir}</autoDeployDir>
    <appServerDeployDir>${liferay.app.server.deploy.dir}</appServerDeployDir>
    <appServerLibGlobalDir>${liferay.app.server.lib.global.dir}</appServerLibGlobalDir>
    <appServerPortalDir>${liferay.app.server.portal.dir}</appServerPortalDir>
    <liferayVersion>${liferay.version}</liferayVersion>
    <parentTheme>${liferay.theme.parent}</parentTheme>
    <pluginType>theme</pluginType>
    <themeType>${liferay.theme.type}</themeType>
  </configuration></plugin>

Please remember that the plugin will still be affected any bugs in the Liferay Portal Version so if you have patches installed you should point the plugin to a patched portal bundle by setting the liferay.app.server.xxx properties. If you discover any bugs in any of the plugin mojos please report them to our MAVEN Jira project.

Threaded Replies Author Date
Hi Mika, very good news!! MavenPlugin version... Denis Signoretto August 26, 2013 3:17 AM
Hi Mika, Good job! But.. I get an exception... Ramon Garcia September 4, 2013 1:55 AM
Hi Mika, do you think maven support should... Denis Signoretto September 12, 2013 7:12 AM

Hi Mika,

very good news!! MavenPlugin version sheme will be changed ? It will be announced indipendently by LPS releases on Liferay Release Dashboard ?

Best Regards,
Denis.
Posted on 8/26/13 3:17 AM.
Hi Mika,
Good job!
But.. I get an exception upgrading one of my projects with ServiceBuilder from 6.1.1 version to 6.1.2, the exception is "Parameter 'directory' is not a directory".
The stacktrace:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.liferay.maven.plugins:liferay-maven-plugin:6.1.2:build-service (default-cli) on project test-portlet-service: Parameter 'directory' is not a directory
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
­at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
­at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
­at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(Lifecycl­eModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(Lifecycl­eModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(Lifecyc­leStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.ja­va:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at­ sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav­a:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:2­90)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java­:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Parameter 'directory' is not a directory
at com.liferay.maven.plugins.AbstractLiferayMojo.execute(AbstractLiferayMojo.java:8­1)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPlugin­Manager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
­... 19 more
Caused by: java.lang.IllegalArgumentException: Parameter 'directory' is not a directory
at org.apache.commons.io.FileUtils.listFiles(FileUtils.java:293)
at org.apache.commons.io.FileUtils.listFiles(FileUtils.java:378)
at com.liferay.maven.plugins.AbstractLiferayMojo.getToolsClassPath(AbstractLiferayM­ojo.java:400)
at com.liferay.maven.plugins.AbstractLiferayMojo.getProjectClassPath(AbstractLifera­yMojo.java:252)
at com.liferay.maven.plugins.ServiceBuilderMojo.getProjectClassPath(ServiceBuilderM­ojo.java:182)
at com.liferay.maven.plugins.AbstractLiferayMojo.getProjectClassLoader(AbstractLife­rayMojo.java:234)
at com.liferay.maven.plugins.ServiceBuilderMojo.doExecute(ServiceBuilderMojo.java:1­67)
at com.liferay.maven.plugins.AbstractLiferayMojo.execute(AbstractLiferayMojo.java:7­4)
... 21 more
Some idea??
Thanks and best regards!
Posted on 9/4/13 1:55 AM.
Hi Mika,

do you think maven support should have it's own discussion forum thread, like other Liferay sub-projects (https://www.liferay.com/it/community/forums/-/message_boards/message-boards-hom­e) ?
Posted on 9/12/13 7:12 AM.