Initially Liferay Maven repository must be added so edit you maven settings xml
$ nano ~/.m2/settings.xml
and add the following
<repository>
<id>liferay-ce</id>
<name>Liferay CE</name>
<url>https://repository.liferay.com/nexus/content/groups/liferay-ce/ </url>
</repository>
…
<pluginRepository>
<id>liferay-plugin</id>
<url>https://repository.liferay.com/nexus/content/groups/liferay-ce/ </url>
</pluginRepository>
Next step is to checkout liferay from liferay git repository.
$ git clone https://github.com/liferay/liferay-maven-support
$ cd liferay-maven-support/
List the available tags
$ git tag -l
should produce a list like that
….
6.1.20
6.1.30
6.2.0
6.2.0-b1
6.2.0-b2
6.2.0-ga1
…6.2.10.1-ga1
Checkout the version you want
$ git checkout tags/6.2.10.1-ga1
Switch to Tag resources
$ git branch -D master
$ git checkout -b master
Build and install Liferay Maven support version 6.2.10-ga1
either with
$ mvn clean package install
for module supprot or for complete liferay artifact support
$ mvn clean install
at the end of the process you should see something like ,
[INFO] ————————————————————————
[INFO] Reactor Summary:
[INFO]
[INFO] Liferay Maven 2 Support ……………………… SUCCESS [ 0.279 s]
[INFO] Liferay Maven 2 Archetypes …………………… SUCCESS [ 0.004 s]
[INFO] Liferay Maven 2 Ext Archetype ………………… SUCCESS [ 1.404 s]
[INFO] Liferay Maven 2 Hook Archetype ……………….. SUCCESS [ 0.326 s]
[INFO] Liferay Maven 2 Layout Template Archetype ……… SUCCESS [ 0.307 s]
[INFO] Liferay Maven 2 Portlet Archetype …………….. SUCCESS [ 0.197 s]
[INFO] Liferay Maven 2 Portlet ICEfaces Archetype …….. SUCCESS [ 0.087 s]
[INFO] Liferay Maven 2 Portlet JSF Archetype …………. SUCCESS [ 0.094 s]
[INFO] Liferay Maven 2 Portlet Liferay Faces Alloy Archetype SUCCESS [ 0.080 s]
[INFO] Liferay Maven 2 Portlet PrimeFaces Archetype …… SUCCESS [ 0.255 s]
[INFO] Liferay Maven 2 Portlet RichFaces Archetype ……. SUCCESS [ 0.064 s]
[INFO] Liferay Maven 2 ServiceBuilder Archetype ………. SUCCESS [ 0.118 s]
[INFO] Liferay Maven 2 Theme Archetype ………………. SUCCESS [ 0.085 s]
[INFO] Liferay Maven 2 Web Archetype ………………… SUCCESS [ 0.379 s]
[INFO] Liferay Maven 2 Plugins ……………………… SUCCESS [ 0.014 s]
[INFO] Liferay Maven 2 Plugin ………………………. SUCCESS [ 3.433 s]
[INFO] ————————————————————————
[INFO] BUILD SUCCESS
[INFO] ————————————————————————
[INFO] Total time: 8.966 s
[INFO] Finished at: 2014-04-30T10:33:43+02:00
[INFO] Final Memory: 28M/210M
Next we want to keep this versioned since we might wish to make changes to the code or to have build integration with Jeknins and artifactory.
For this reason a liferay svn repository is created, if you want to know more about the configuration you can check my previous post.
$ svnadmin create /usr/local/svn/repos/liferay
$ nano /usr/local/svn/repos/liferay/conf/svnserve.conf
[general]
#anon-access = none
anon-access = read
auth-access = write
password-db = /usr/local/svn/passwd-team
realm = Team
Ctrl-X to save
Then back to the directory you checked out liferay with maven support , checkout your empty repository
$ svn checkout svn://localhost/liferay .
Add all to subversion recursively
$ svn add * –force
$ svn commit ‘Initial Version’
For a “How-To” Build Integration with Jenkins and Artifactory, you can read my earlier post .
References: how-to-configure-liferay-maven-plugin-module-with-liferay-portal-6-2