« Back

Liferay's artifact are now Mavenized

Company Blogs July 20, 2010 By Thiago Leão Moreira Staff

  Hi there!

  We are glad to announce for all those of you Maven adicted like me , that now Liferay has its artifacts public in a Maven 2 repository! The community request was listened and answered.

  The repository contains artifacts of version 6.0.2 and 6.0.3. The deployed artifacts are:

Core projects:

  • portal-client
  • portal-impl
  • portal-service
  • portal-web
  • util-bridges
  • util-java
  • util-taglib

Maven plugins:

  • liferay-layouttpl-archetype
  • liferay-maven-plugin
  • liferay-portlet-archetype
  • liferay-theme-archetype

   The repository is http://oss.sonatype.org/content/groups/public you can have access to release and snapshot versions of the artifacts. The snapshots artifacts are build and deploy once a day.  

  To use it you should reference it in your POM (you can also set the repository information in your settings.xml file) and declare your dependencies, like the sample that follows. The artifacts are being synced with Central, so you don't need to declare the repository if you are not using SNAPSHOT versions.

 <project>
   ...

   <repositories>
        <repository>
            <id>liferay-repository</id>
            <name>Liferay's Maven repository</name>
            <url>http://oss.sonatype.org/content/groups/public</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>com.liferay</groupId>
            <artifactId>portal-service</artifactId>
            <version>6.0.3</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    ...
</project>

  Then you can use all the Maven functionality to manage your development.

  This is one more step to get closer to the Maven community, so let us know if you have questions/ideas/suggestions and please enjoy!!!

  Um abraço!

p.s. Liferay's dream #2 completed :-)

Threaded Replies Author Date
That's awesome Thiago!!! Shagul Khajamohideen July 20, 2010 7:03 AM
Fantastic. Some dreams come true :) Pavel Rodionov July 20, 2010 8:11 AM
Great work and a great relief! :) Henrik Bernström July 20, 2010 10:50 AM
Cool. I'd like to see an option when creating... S L B July 20, 2010 10:51 AM
Thanks, great work :) Would it be realistic to... Baptiste Grenier July 20, 2010 1:30 PM
Good work. The ext-plugin support would be also... Sampsa Sohlman July 21, 2010 6:43 AM
That's great news. I do not need to search for... Brian Ko July 22, 2010 3:26 PM
Hey Brian, You should be able to see them... Thiago Leão Moreira July 22, 2010 3:43 PM
Great I see the files at central Should there... anders kristian andersen August 8, 2010 2:10 PM
How would/should my local mvn setting.xml look... Yeong Sheng Tan August 9, 2010 8:36 PM
Hi Yeong, You don't need to add Liferay's... Thiago Leão Moreira August 10, 2010 6:51 AM
But I am getting errors with my mvn compile for... Yeong Sheng Tan August 10, 2010 9:27 AM
Sorry, my pom.xml again as below: <?xml... Yeong Sheng Tan August 10, 2010 9:30 AM
Error received is: Missing: ---------- 1)... Yeong Sheng Tan August 10, 2010 9:33 AM
Think I might have found the issue; The sample... Yeong Sheng Tan August 10, 2010 9:44 AM
Hi Anders, The pom.xml files are available at... Thiago Leão Moreira August 10, 2010 6:45 AM
Hi Thiango Okay I see the pom files now :-) I... anders kristian andersen August 10, 2010 12:07 PM
This is excellent development. Thank you for... Heimo Laukkanen August 6, 2010 1:15 AM
What did happen the "portal-kernel" artifact? ... Sampsa Sohlman August 9, 2010 9:30 PM
Hi Sampsa, portal-kernel was merged into... Thiago Leão Moreira August 10, 2010 6:48 AM
Thiago, I did found couple of bugs, the first... Sampsa Sohlman August 17, 2010 12:33 PM
This is the best thing that's happened since... Ryan Connolly October 19, 2010 6:46 PM
I just tried using the liferay-theme-archetype... David Stahl October 26, 2010 6:35 PM
Hi Robert... Did you happen to do a mvn package... Ryan Connolly October 27, 2010 8:44 AM
Robert, What is the name of the file? I heard... Brian Ko October 27, 2010 9:04 AM
Brian, I created another project from the... David Stahl October 27, 2010 2:44 PM
Hi, Thiago, It looks like the source code is... Brian Ko November 10, 2010 10:42 AM
Hey Brian, Artifacts of releases older than... Thiago Leão Moreira November 10, 2010 10:47 AM
Hei Brian, I believe that you are talking... Sampsa Sohlman November 10, 2010 9:34 PM
Hi Sampsa, Maybe you are right. However, I... Brian Ko November 11, 2010 9:22 AM
Now that I have had the pleasure to begin... Ryan Connolly November 11, 2010 4:11 AM
Hi Ryan, I am doing same kind of project. But... Brian Ko November 11, 2010 9:38 AM
Hi Brian, I would be happy to help you out... Ryan Connolly November 12, 2010 7:19 AM
Hi Ryan, I followed the process described in... Brian Ko November 12, 2010 10:01 AM
Brian: If you are using maven 2.x or... Ryan Connolly November 12, 2010 4:29 PM
Thiago: I've begun creating a maven plugin... Ryan Connolly January 17, 2011 9:02 AM
I think the reason for these 177 dependencies... anders kristian andersen January 17, 2011 9:22 AM
Anders: Thanks for your reply. I have no... Ryan Connolly January 17, 2011 2:32 PM
Hey Ryan, The reason for not have these... Thiago Leão Moreira January 17, 2011 2:28 PM
Thanks, Thiago. This makes more sense. I'm... Ryan Connolly January 17, 2011 2:34 PM
Forgot to mention that I would be MORE than... Ryan Connolly January 17, 2011 2:36 PM
Hi Thiago Actually this also means that it is... Sampsa Sohlman January 18, 2011 9:26 AM
Hey Sampsa, Actually this is not true. I have... Thiago Leão Moreira January 18, 2011 11:27 AM
Could you please publish 6.0.6 artifacts to... Andrius Kurtinaitis March 22, 2011 8:50 AM
http://loongest.com/liferay/liferay-glassfish-i... mark zain January 31, 2011 6:22 AM
[...] Maybe this helps... Anonymous May 11, 2011 2:15 AM
[...] Eis alguns links que me ajudaram muito:... Anonymous May 28, 2011 8:11 AM
Hello I've just started working with liferay... n b June 28, 2011 1:54 AM
Hi n b, 1) you should create a portlet... Thiago Leão Moreira June 28, 2011 5:02 AM
Where are the transitive dependencies defined? ... Albert Liptay August 23, 2011 12:09 PM
Hey Albert, Liferay is not built by Maven so... Thiago Leão Moreira August 23, 2011 5:34 PM
It is unfortunate, Liferay is not build by... Artur Linhart November 30, 2011 11:24 PM
I have liferay 6.0_ee version (Liferay Portal... Ankur Jaswal January 27, 2012 11:23 AM
Ankur you must use the same version of jars as... Mika Koivisto February 2, 2012 4:40 PM

That's awesome Thiago!!!
Posted on 7/20/10 7:03 AM.
Fantastic. Some dreams come true emoticon
Posted on 7/20/10 8:11 AM.
Great work and a great relief! emoticon
Posted on 7/20/10 10:50 AM.
Cool. I'd like to see an option when creating an ext plugin to use maven. Or just a standard pom file next to the ant script inside ext.zip.
Posted on 7/20/10 10:51 AM.
Thanks, great work emoticon

Would it be realistic to hope having the portal war stored into the maven repository?

I know that it's quite heavy but it's wonderful to use with the war overlay capability of maven for quickly cleanly and easily creating customized wars of the portal...
Posted on 7/20/10 1:30 PM.
Good work. The ext-plugin support would be also very welcome.
Posted on 7/21/10 6:43 AM.
That's great news. I do not need to search for the jar file and deploy to my own repository any more. However, I cannot see the jar files in the maven2 repository. I see only 4.2.1 source. Were they deployed?

Brian
Posted on 7/22/10 3:26 PM.
Hey Brian,

You should be able to see them here: http://repo2.maven.org/maven2/com/liferay/
Maybe your browser has cached the page... but all artifacts are there.
Posted on 7/22/10 3:43 PM in reply to Brian Ko.
This is excellent development.

Thank you for making our life little easier.
Posted on 8/6/10 1:15 AM.
Great I see the files at central
Should there also be pom.xml files in http://svn.liferay.com/repos/public/portal/trunk /... ?
Posted on 8/8/10 2:10 PM in reply to Thiago Leão Moreira.
How would/should my local mvn setting.xml look like then? My local mvn setting.xml also points to a mirror local nexus with sonar stuff (see below). Does it make sense to add the above the way I have added below to make my new mvn build of custom liferay portlets work?

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>/Users/yeongshe­ng/sdk/mvn/repo</localRepository>
<interactiveMode>true</interactiveMode>
<mirrors­>
<mirror>
<id>nexus</id>
<mirrorOf>*,!sonar</mirrorOf>
<name>Sambaash Maven Cloud CI Server Nexus.</name>
<url>http://sit.sambaash.com:8180/nexus/content/groups/public</url>
</mirror>

<mirror>
<id>liferay-repository</id>
<mirrorOf>*</mirrorOf>
<name>Liferay's Maven repository</name>
<url>http://oss.sonatype.org/content/groups/public</url>
</mirror>
</mirrors>

<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the build in central report to direct all requests to nexus via the mirror-->
<repositories>
<repository>
<id>central</id>
<name>Repository for Sambaash Platform 2.0 Builds</name>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
<!--<snapshotPolicy>always</snapshotPolicy>-->
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
Posted on 8/9/10 8:36 PM in reply to anders andersen.
What did happen the "portal-kernel" artifact?

On 5.2 EE sp3 and sp4, it is still required.
Posted on 8/9/10 9:30 PM.
Hi Anders,

The pom.xml files are available at trunk/tools/maven directory.
Posted on 8/10/10 6:45 AM in reply to anders andersen.
Hi Sampsa,

portal-kernel was merged into portal-service in the release 6.0.x. It was an architectural decision that was replicated by the Maven artifacts.
Posted on 8/10/10 6:48 AM in reply to Sampsa Sohlman.
Hi Yeong,

You don't need to add Liferay's repository because the artifacts are available at central.
Posted on 8/10/10 6:51 AM in reply to Yeong Sheng Tan.
But I am getting errors with my mvn compile for Liferay Vaadin project. My project pom.xml as below:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>sambaash.platform</groupId>
<artifactId>Sambaash-Vaadin</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>Sambaash Vaadin Portal Application</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<sourceDirectory>src</sourceDirectory>
<outputDirectory>war/WEB-INF/classes</outputDirectory>
<defaultGoal>deploy</defaultGoal>
<finalName>Sambaash-Vaadin</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin</artifactId>
<version>6.4.1</version>
</dependency>
<dependency>
<groupId>com.liferay</groupId>
<artifactId>portal-service</artifactId>
<version>6.0.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

Error I am getting is:

Yeong-Shengs-MacBook-Pro:Sambaash-Vaadin yeongsheng$ mvn compile
Scanning for projects...
------------------------------------------------------------------------
Building Sambaash Vaadin Portal Application
task-segment:
------------------------------------------------------------------------
[resources:resources {execution: default-resources}]
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory /Users/yeongsheng/repo/sambaash.corporate.vaadin/Sambaash-Vaadin/src/main/resour­ces
Downloading: http://sit.sambaash.com:8180/nexus/content/groups/public/com/liferay/portal-serv­ice/6.0.2/portal-service-6.0.2.pom
Unable to find resource 'com.liferay:portal-service:pom:6.0.2' in repository central (http://central)
Downloading: http://sit.sambaash.com:8180/nexus/content/groups/public/com/liferay/portal-serv­ice/6.0.2/portal-service-6.0.2.jar
Unable to find resource 'com.liferay:portal-service:jar:6.0.2' in repository central (http://central)
------------------------------------------------------------------------
BUILD ERROR
------------------------------------------------------------------------
Failed to resolve artifact.

Missing:
----------
1) com.liferay:portal-service:jar:6.0.2

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=com.liferay -DartifactId=portal-service -Dversion=6.0.2 -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.liferay -DartifactId=portal-service -Dversion=6.0.2 -Dpackaging=jar -Dfile=/path/to/file -Durl= -DrepositoryId=

Path to dependency:
1) sambaash.platform:Sambaash-Vaadin:war:1.0
2) com.liferay:portal-service:jar:6.0.2

----------
1 required artifact is missing.

for artifact:
sambaash.platform:Sambaash-Vaadin:war:1.0

from the specified remote repositories:
nexus (http://sit.sambaash.com:8180/nexus/content/groups/public)



------------------------------------------------------------------------
For more information, run Maven with the -e switch
------------------------------------------------------------------------
Total time: 2 seconds
Finished at: Wed Aug 11 00:17:16 SGT 2010
Final Memory: 9M/265M
------------------------------------------------------------------------
Posted on 8/10/10 9:27 AM in reply to Thiago Leão Moreira.
Sorry, my pom.xml again as below:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>sambaash.platform</groupId>
<artifactId>Sambaash-Vaadin</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>Sambaash Vaadin Portal Application</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<sourceDirectory>src</sourceDirectory>
<outputDirectory>war/WEB-INF/classes</outputDirectory>
<defaultGoal>deploy</defaultGoal>
<finalName>Sambaash-Vaadin</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>

<repositories>
<repository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin</artifactId>
<version>6.4.1</version>
</dependency>
<dependency>
<groupId>com.liferay</groupId>
<artifactId>portal-service</artifactId>
<version>6.0.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Posted on 8/10/10 9:30 AM in reply to Yeong Sheng Tan.
Error received is:

Missing:
----------
1) com.liferay:portal-service:jar:6.0.2

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=com.liferay -DartifactId=portal-service -Dversion=6.0.2 -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.liferay -DartifactId=portal-service -Dversion=6.0.2 -Dpackaging=jar -Dfile=/path/to/file -Durl= -DrepositoryId=

Path to dependency:
1) sambaash.platform:Sambaash-Vaadin:war:1.0
2) com.liferay:portal-service:jar:6.0.2

----------
1 required artifact is missing.

for artifact:
sambaash.platform:Sambaash-Vaadin:war:1.0

from the specified remote repositories:
nexus (http://sit.sambaash.com:8180/nexus/content/groups/public)
Posted on 8/10/10 9:33 AM in reply to Yeong Sheng Tan.
Think I might have found the issue; The sample pom.xml dependency provided above missed out portal in the groupId. i.e. it should be com.liferay.portal instead of com.liferay only for groupId def provided.

The corrected sample should look:
<project>
...

<repositories>
<repository>
<id>liferay-repository</id>
<name>Liferay's Maven repository</name>
<url>http://oss.sonatype.org/content/groups/public</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId>
<version>6.0.3</version>
<scope>provided</scope>
</dependency>
</dependencies>

...
</project>
Posted on 8/10/10 9:44 AM in reply to Yeong Sheng Tan.
Hi Thiango
Okay I see the pom files now :-)

I have also made a some of the sample portlets work from Maven, so it is easy to start them from shell>> idea pom.xml ...

I dont know if you are interested in getting these ?
Posted on 8/10/10 12:07 PM in reply to Thiago Leão Moreira.
Thiago, I did found couple of bugs, the first one is easily fixed (LPS-12090) and solution is there, but second one (LPS-12095) is littlebit more complicated.
Posted on 8/17/10 12:33 PM.
This is the best thing that's happened since discovering liferay! Great thanks to all who contributed to the devlopment of a liferay sdk maven plugin and getting everything up on Central! Having just tried out some of the archetypes and deploying with the plugin, I must say I am one happy developer!

Thanks again!
Posted on 10/19/10 6:46 PM.
I just tried using the liferay-theme-archetype and generated a maven project. Without changing anything I ran liferay:deploy and it successfully was pushed out to my local copy of liferay; however, when I looked at the available themes it was not there. It was listed under Portlet Plugins. Has anyone had any success building and deploying a theme using the liferay-theme-archetype? I am trying to determine if there is something that I missed.
Posted on 10/26/10 6:35 PM.
Hi Robert... Did you happen to do a mvn package or mvn install before running liferay:deploy goal? I'm guessing maybe the liferay:theme-merge goal was not run but I could be wrong about this. What I've done is bind the liferay:deploy goal to the package phase in my build as the archetype came with liferay:theme-merge and liferay:build-thumbnail already bound to the generate-sources phase.

btw: I'm using 6.0.5, not sure if that helps you out in any way.
Posted on 10/27/10 8:44 AM in reply to Robert McKinnon.
Robert,
What is the name of the file? I heard that Liferay recognizes it as a theme only when the file name includes "theme" in it.

Brian
Posted on 10/27/10 9:04 AM in reply to Robert McKinnon.
Brian, I created another project from the liferay-theme-archetype and named the artifact -theme. This fixed the problem.
Posted on 10/27/10 2:44 PM in reply to Brian Ko.
Hi, Thiago,

It looks like the source code is updated now. After I follow the steps you explained, I got build error as it cannot locate the liferay-lib-5.2.3-r2.pom. Do you know where I can find this pom file?
Thank you.

Brian
Posted on 11/10/10 10:42 AM.
Hey Brian,

Artifacts of releases older than 6.0.2 are NOT available on any public repository. Sorry about that.
Posted on 11/10/10 10:47 AM in reply to Brian Ko.
Hei Brian,

I believe that you are talking about liferay maven sdk made by Milen Dyankov

https://github.com/azzazzel/liferay-maven-sdk/

- Sampsa

- Sampsa
Posted on 11/10/10 9:34 PM in reply to Brian Ko.
Now that I have had the pleasure to begin planning a new project based on liferay and have played a bit with the portlet and theme archetypes, I'm wondering if anyone could offer up any advice, tips/tricks in regards to rapid theme and portlet development in a maven environment? The archetypes and the mojos work wonderfully for getting a new project started and deployed to liferay, however it is the slow process of not being able to see changes until the project is deployed to liferay that is a killer for a team of developers. Does anyone know how a developer might make theme changes and see them immediately in a browser before deploying to liferay? Any input on this subject would be greatly appreciated!

Thanks in advance,
-Ryan
Posted on 11/11/10 4:11 AM.
Hi Sampsa,

Maybe you are right. However, I followed the instruction on this article to create a project and end up with pom.file like following. Since there is no liferay-lib-5.2.3-r2.pom, I cannot go further. Can you guess what I did wrong?
Thank you.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLS­chema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<g­roupId>liferay</groupId>
<artifactId>sample</artifactId>
<packaging>war</packagi­ng>
<version>1.0-SNAPSHOT</version>
<name>Maven Portlet Archetype</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency­>
<groupId>com.commsen.liferay</groupId>
<artifactId>liferay-lib</arti­factId>
<version>5.2.3-r2</version>
<scope>provided</scope>
<type­>pom</type>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>­
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<sco­pe>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</­groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
</de­pendency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standa­rd</artifactId>
<version>1.1.2</version>
</dependency>
</dependencies>

<p­roperties>
<service.api.folder>src/main/java-service-api</service.api.folder>
­</properties>

<profiles>
<profile>
<id>default profile</id>
<activation>
<activeByDefault>true</activeByDefault>
­ </activation>
</profile>
<profile>
<id>translate</id>
<activati­on>
<property>
<name>translate</name>
</property­>
</activation>
<build>
<plugins>
<plugin>
­ <groupId>com.commsen.liferay</groupId>
<artifactId­>liferay-maven-plugin</artifactId>
<executions>
­ <execution>
<phase>generate-sources<­/phase>
<goals>
­ <goal>translate</goal>
</goals>
­ <configuration>
­ <langDir>${basedir}/src/main/resources/content</langDir>
­ <langFile>Language</langFile>
­ </configuration>
</execution>
­ </executions>
</plugin>
</plugins>
</build>
</­profile>
<profile>
<id>build-service</id>
<activation>
<pro­perty>
<name>build-service</name>
</property>
</acti­vation>
<build>
<plugins>
<plugin>
­ <groupId>com.commsen.liferay</groupId>
<artifactId>lifera­y-maven-plugin</artifactId>
<executions>
­ <execution>
<phase>generate-sources</phase­>
<goals>
­ <goal>build-service</goal>
</goals>
­ <configuration>
<serv­iceApiFolderName>${service.api.folder}</serviceApiFolderName>
­ </configuration>
</execution>
­ </executions>
</plugin>
</plugins>
</build>
</pro­file>
<profile>
<id>service builder profile</id>
<activation>
<file>
<exists>src/main/we­bapp/WEB-INF/service.xml</exists>
</file>
</activation>
<depe­ndencies>
<dependency>
<groupId>com.commsen.liferay.porta­l.libraries</groupId>
<artifactId>util-java</artifactId>
­ <version>5.2.3</version>
</dependency>
</dependencies>
<buil­d>
<plugins>
<plugin>
<groupId>org.co­dehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin<­/artifactId>
<version>1.3</version>
<exe­cutions>
<execution>
­ <id>add-source</id>
<phase>generate-source­s</phase>
<goals>
­ <goal>add-source</goal>
</goals>
­ <configuration>
<sources>
­ <source>${service.api.folder}</sour­ce>
</sources>
­ </configuration>
</execution>
­ </executions>
</plugin>
</plugins>
</build>­
</profile>
</profiles>

<build>
<plugins>
<plugin>
<artifactId­>maven-compiler-plugin</artifactId>
<configuration>
<sour­ce>1.5</source>
<target>1.5</target>
</configuration>
­ </plugin>
</plugins>
</build>
</project>
Posted on 11/11/10 9:22 AM in reply to Sampsa Sohlman.
Hi Ryan,

I am doing same kind of project. But I am having an issue to create a maven project with proper dependencies. I wonder if you can post or email (bko@behr.com) the pom.xml file created by portlet archetype. As you can see on my post, mine has a dependency to the pm file I cannot find. Thank you in advance.

Brian
Posted on 11/11/10 9:38 AM in reply to Ryan Connolly.
Hi Brian,
I would be happy to help you out however I am running LR 6.0.5 and it would appear that artifacts started getting deployed to maven central at version 6.0.2 (as stated by the OP). The dependency you are trying to fetch does not exist in central (http://www.jarvana.com/jarvana/search?search_type=project&project=liferay). This being said, I believe Sampsa is right in that for pre-6.0.2 versions your maven options pretty much boil down to azzazzel's implementation.

Hope that helps,
-Ryan
Posted on 11/12/10 7:19 AM in reply to Brian Ko.
Hi Ryan,

I followed the process described in http://www.liferay.com/community/wiki/-/wiki/Main/Liferay+Maven+SDK. It ends up with portlet with the 5.2.3 dependencies. I guess that is the problem. Have you followed differest steps to create your project?
Thank you.
Brian
Posted on 11/12/10 10:01 AM in reply to Ryan Connolly.
Brian:
If you are using maven 2.x or higher (m3) you should not need to add any repositories to nexus or to your settings.xml. If you have, my best bet is that you can undo everything that thread tells you to do in regards to configuring the liferay repos as everything needed to create and deploy portlets/themes/hooks is present in maven central for versions 6.0.2-6.0.5. Once you've removed the liferay repo configuration simply invoke a "mvn archetype:generate" and enter the number that corresponds to the archetype you wish to use to create your project. I've used both the theme and portlet archetypes successfully for version 6.0.5.

HTH,
-Ryan
Posted on 11/12/10 4:29 PM in reply to Brian Ko.
Thiago:
I've begun creating a maven plugin that will emulate the tomcat-maven-plugin's "run" goal that combined with the liferay maven portlet archetype will allow for rapid portlet development in an embedded tomcat container. I was hoping to use the portal-web-6.0.5.war artifact currently present in maven central but it would appear that this artifact lacks all but one of the 178 dependencies found in the war obtained from the "Additional Files" download page of the liferay 6 war. Is there any reason why the war's dependencies are not present in the maven artifact and are there any future plans of making the portal-web.war maven artifact deployable w/out the consumer having to find 177 additional dependencies and manually copying them to the WEB-INF/lib directory? I'm currently working around this issue by deploying the working war file obtained from the "Additional Files" download page to our internal Nexus repo but was hoping users of the plugin would not have to do the same.

Could you offer any information on this? Any feedback at all would be GREATLY appreciated and want you to know that I have every intention of contributing this plugin to the community.

Thanks in advance,
-Ryan
Posted on 1/17/11 9:02 AM.
I think the reason for these 177 dependencies are not there is that they are provided (all ready on the server CP) the way liferay originally works.

A solution could be to make a pom-artifact with all these dependencies and then depend on it as "provided", and it would be solid maven. Then you could overload the dependency "local" without provided.
Posted on 1/17/11 9:22 AM in reply to Ryan Connolly.
Hey Ryan,

The reason for not have these dependencies is that Liferay is not built by Maven and the pom generated is the simplest as possible.
Posted on 1/17/11 2:28 PM in reply to Ryan Connolly.
Anders:
Thanks for your reply. I have no doubt that the portal-web artficact's POM is declaring its dependencies as provided but I would have to argue that this is not the correct use of the provided scope. Provided scope is typically used to declare a dependency that is required for compilation that the web/app container already provides (servlet-api for example). I have yet to see a container (tomcat, jetty, etc) that comes bundled with spring, easyconf, etc so I would maintain that most of the dependencies that the portal-web project declares as provided are actually compile and/or runtime dependencies. The versions of these dependencies are meant for portal-web and it should not be assumed that all other wars running in the same container (portlets, etc) use the same version of spring for example. This is not a container provided dependency. It seems ridiculous to me to expect a consumer of this war to be able to determine not only WHAT 177 dependencies are missing but what VERSION of each dependency is missing. I would think that some dependencies could certainly be provided scope but I'm guessing most should really be bundled with the deployed war artifact upon release to central.

Looking forward to other's input.

Thanks,
-Ryan
Posted on 1/17/11 2:32 PM in reply to anders kristian andersen.
Thanks, Thiago. This makes more sense. I'm guessing maybe the maven ant tasks are being used in this case then? Any plans on updating in future releases to include all dependencies in the released artifact? As it stands, the war is more or less unusable from central w/out some additional work.

Thanks for the reply!
-Ryan
Posted on 1/17/11 2:34 PM in reply to Thiago Leão Moreira.
Forgot to mention that I would be MORE than happy to contribute some time to the effort of getting the portal-web pom into a more accurate state. Anything I might do to help with this effort?

-Ryan
Posted on 1/17/11 2:36 PM in reply to Thiago Leão Moreira.
Hi Thiago

Actually this also means that it is impossible example to create ext-plugin support for maven as Liferay internal dependencies are not published.

- Sampsa
Posted on 1/18/11 9:26 AM in reply to Thiago Leão Moreira.
Hey Sampsa,

Actually this is not true. I have been researching how to implement the ext-plugin for Maven and this is not a road blocker.
Posted on 1/18/11 11:27 AM in reply to Sampsa Sohlman.
http://loongest.com/liferay/liferay-glassfish-installation/ by chee from f-secure corporation.
Posted on 1/31/11 6:22 AM in reply to Sampsa Sohlman.
Could you please publish 6.0.6 artifacts to some public repo?
Posted on 3/22/11 8:50 AM in reply to Thiago Leão Moreira.
[...] Maybe this helps https://github.com/mikakoivisto/liferay-maven-incubation http://www.liferay.com/web/thiago.moreira/blog/-/blogs/liferay-s-artifact-are-no­w-mavenized... [...] Read More
Posted on 5/11/11 2:15 AM.
[...] Eis alguns links que me ajudaram muito: http://www.liferay.com/community/wiki/-/wiki/1071674/maven+sdk/maximized http://www.liferay.com/web/thiago.moreira/blog/-/blogs/1714575/maximized... [...] Read More
Posted on 5/28/11 8:11 AM.
Hello
I've just started working with liferay and building portlets, and have found this post via my google travells for maven and liferay 6.0.5. I've read hints of things regrading a maven-liferay-sdk from 2009 and various posts about creating or using the liferay-portlet-archetype but I'm still not sure who to continue. Is there a tutorial that explains what is possible and how to do it? I'm specifically interested in
1) How to build a portlet using the liferay-portlet-archetype using maven
2) Can the liferay IDE be used to build portlets using the same maven set up but also deploy using maven?
thanks for any pointers
Posted on 6/28/11 1:54 AM in reply to .
Hi n b,

1) you should create a portlet project from a archetype as you would create for any other archetype.
2) No, Liferay IDE does not support Maven until now.
Posted on 6/28/11 5:02 AM in reply to nomit babraa.
Where are the transitive dependencies defined? 6.0.6, maven-war-plugin overlay to portal-web and I'm stuck having to copy all the jars to my web-inf lib...
Posted on 8/23/11 12:09 PM in reply to Thiago Leão Moreira.
Hey Albert,

Liferay is not built by Maven so we don't have the tracking of transitive dependencies.
Posted on 8/23/11 5:34 PM in reply to Albert Liptay.
It is unfortunate, Liferay is not build by maven itself...
What about test and test-sources artifacts? For example, if I want tod evelop tests for services and I want to use
com.liferay.portal.service.BaseServiceTestCase
I still do not have any chance to do it without sharing the whole portal stuff into the mavenized project or do something similar...
Posted on 11/30/11 11:24 PM in reply to Thiago Leão Moreira.
I have liferay 6.0_ee version (Liferay Portal Enterprise Edition 6.0 EE (Bunyan / Build 6010 / September 7, 2010) ) , are the compatible jars in the public maven repository http://oss.sonatype.org/content/groups/public. I saw there are 6.0.2 and 6.0.3 - I am not sure if these are compatible to the liferay version I am using. Any ideas ?
Posted on 1/27/12 11:23 AM.
Ankur you must use the same version of jars as your portal. EE versions are not available in public maven repositories but you can deploy them to your local repository using normal maven way of installing or deploying thirdparty jars that are not available publicly. so use mvn install:install-file or mvn deploy:deploy-file goals.

For 6.1 we are providing a convenient installer package that will install or deploy all of them with just one command.
Posted on 2/2/12 4:40 PM in reply to Ankur Jaswal.