« Zurück

Liferay's artifact are now Mavenized

Company Blogs 20. Juli 2010 Von 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 :-)

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

Gepostet am 20.07.10 07:03.
Gepostet am 20.07.10 08:11.
Gepostet am 20.07.10 10:50.
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.
Gepostet am 20.07.10 10:51.
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...
Gepostet am 20.07.10 13:30.
Good work. The ext-plugin support would be also very welcome.
Gepostet am 21.07.10 06:43.
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
Gepostet am 22.07.10 15:26.
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.
Gepostet am 22.07.10 15:43 als Antwort auf Brian Ko.
This is excellent development.

Thank you for making our life little easier.
Gepostet am 06.08.10 01:15.
Great I see the files at central
Should there also be pom.xml files in http://svn.liferay.com/repos/public/portal/trunk /... ?
Gepostet am 08.08.10 14:10 als Antwort auf 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>
Gepostet am 09.08.10 20:36 als Antwort auf anders andersen.
What did happen the "portal-kernel" artifact?

On 5.2 EE sp3 and sp4, it is still required.
Gepostet am 09.08.10 21:30.
Hi Anders,

The pom.xml files are available at trunk/tools/maven directory.
Gepostet am 10.08.10 06:45 als Antwort auf 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.
Gepostet am 10.08.10 06:48 als Antwort auf Sampsa Sohlman.
Hi Yeong,

You don't need to add Liferay's repository because the artifacts are available at central.
Gepostet am 10.08.10 06:51 als Antwort auf 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
------------------------------------------------------------------------
Gepostet am 10.08.10 09:27 als Antwort auf 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>
Gepostet am 10.08.10 09:30 als Antwort auf 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)
Gepostet am 10.08.10 09:33 als Antwort auf 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>
Gepostet am 10.08.10 09:44 als Antwort auf 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 ?
Gepostet am 10.08.10 12:07 als Antwort auf 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.
Gepostet am 17.08.10 12:33.
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!
Gepostet am 19.10.10 18:46.
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.
Gepostet am 26.10.10 18:35.
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.
Gepostet am 27.10.10 08:44 als Antwort auf 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
Gepostet am 27.10.10 09:04 als Antwort auf Robert McKinnon.
Brian, I created another project from the liferay-theme-archetype and named the artifact -theme. This fixed the problem.
Gepostet am 27.10.10 14:44 als Antwort auf 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
Gepostet am 10.11.10 10:42.
Hey Brian,

Artifacts of releases older than 6.0.2 are NOT available on any public repository. Sorry about that.
Gepostet am 10.11.10 10:47 als Antwort auf 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
Gepostet am 10.11.10 21:34 als Antwort auf 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
Gepostet am 11.11.10 04:11.
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>
Gepostet am 11.11.10 09:22 als Antwort auf 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
Gepostet am 11.11.10 09:38 als Antwort auf 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
Gepostet am 12.11.10 07:19 als Antwort auf 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
Gepostet am 12.11.10 10:01 als Antwort auf 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
Gepostet am 12.11.10 16:29 als Antwort auf 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
Gepostet am 17.01.11 09:02.
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.
Gepostet am 17.01.11 09:22 als Antwort auf 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.
Gepostet am 17.01.11 14:28 als Antwort auf 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
Gepostet am 17.01.11 14:32 als Antwort auf 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
Gepostet am 17.01.11 14:34 als Antwort auf 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
Gepostet am 17.01.11 14:36 als Antwort auf 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
Gepostet am 18.01.11 09:26 als Antwort auf 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.
Gepostet am 18.01.11 11:27 als Antwort auf Sampsa Sohlman.
http://loongest.com/liferay/liferay-glassfish-installation/ by chee from f-secure corporation.
Gepostet am 31.01.11 06:22 als Antwort auf Sampsa Sohlman.
Could you please publish 6.0.6 artifacts to some public repo?
Gepostet am 22.03.11 08:50 als Antwort auf 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
Gepostet am 11.05.11 02:15.
[...] 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
Gepostet am 28.05.11 08:11.
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
Gepostet am 28.06.11 01:54 als Antwort auf .
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.
Gepostet am 28.06.11 05:02 als Antwort auf 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...
Gepostet am 23.08.11 12:09 als Antwort auf Thiago Leão Moreira.
Hey Albert,

Liferay is not built by Maven so we don't have the tracking of transitive dependencies.
Gepostet am 23.08.11 17:34 als Antwort auf 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...
Gepostet am 30.11.11 23:24 als Antwort auf 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 ?
Gepostet am 27.01.12 11:23.
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.
Gepostet am 02.02.12 16:40 als Antwort auf Ankur Jaswal.