Thursday 7 August 2014

Maven Portlet Development - For Command Prompt Lovers


  • Navigate to the folder where you want to create Liferay plugin
  • Execute the command mvn archetype:generate. This will take some time for the first time. You might need to rerun this command for twice to get it complete.
  • It will ask to choose a number or apply filter. Enter filter for Liferay, simply type liferay and hit enter.
  • Select proper archetype for particular pulgin e.g for Liferay portlet pulgin select liferay-portlet-archetype
  • Enter liferay portlet archetype version. E. g. Version of Liferay, for our case we need to choose 6.2.0-RC5.
  • Define value for property 'groupId': :org.wellOfJava.portlet. i. e. groupId will identify your project uniquely across all projects.
  • Define value for property 'artifactId': : sample-portlet. i. e. Name of the portlet. 
  • Define value for property 'version':  1.0-SNAPSHOT: : 1.0-SNAPSHOT  (or here you can just press enter)
  • Define value for property 'package':  org.wellOfJava.portlet: : org.wellOfJava.portlet. That will be package structure of your portlet.
  • Add properties tag in pom.xml after </dependencies> tag and before </project> end tag
  • <properties>
    <liferay.version>6.2.0-RC5</liferay.version>
    <liferay.maven.plugin.version>6.2.0-RC5</liferay.maven.plugin.version>
    </properties>
    
  • Navigate to the directory, where pom.xml of the plugin exist. Execute the command mvn clean install –DskipTests. For building war file
  • After successful build import into eclipse

0 comments:

Post a Comment