Liferay Build From Source and Deploy to Local Maven Repository

First of all download source from or you can download from svn using following command

svn –username guest co svn:// portal-trunk

Once you download source extract to one Folder.(Dont have long path it might cross maximum path length in windows if you store this deep inside some path)



ANT: Download apache ant and place it in path

Below one is needed for deployment to maven repository

GPG :  (You might have to get older version as build searches for gpg.exe )

Older version can be downloaded from

If you want to setup maven repository on your machine then do the following

  1. Download nexus(Opensource Maven Repository) from
  2. Follow following instructions for Installation
  3. Start nexus and Open your browser to your newly created nexus (http://localhost:8081/nexus)
  4. Login as administrator (default login is admin / admin123) and Change your password
  5. Go to Repositories and click Add -> Hosted Repository
  6. Create Hosted Repository
  • Repository ID: liferay-ce-snapshots
  • Repository Name: Liferay Snapshot Repository
  • Provider: Maven2 Repository
  • Repository Policy: Snapshot
Now configure your maven to point to local repository
<?xml version="1.0" encoding="UTF-8"?> 
			<name>Local mirror repository</name> 

Now Goto to folder where you have liferay source

Open  and paste following in bottom  ( You can use other property file names . Just look at build-common.xml for more property filenames you can use)




Now Lets generate Key File using GPG which we downloaded before



Once you generate the key. you can now use it in deployment.

Now follow these steps

  1. C:\liferay-portal-src-6.0.6>set ANT_OPTS=”-Xmx1024m -XX:MaxPermSize=256m”
  2. ant jar
  3. ant -f build-maven.xml deploy-artifacts ( This will deploy all the Liferay Artifacs to maven repository you have just configured using nexus)
Now njoy using maven with liferay. Next articles would be to create portlets in Liferay and Using liferay to create portals










    Leave a Reply

    Fill in your details below or click an icon to log in: Logo

    You are commenting using your account. Log Out /  Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )


    Connecting to %s