
« Zurück zu Liferay IDE
m2e-liferay Quick Start Tutorial
Introduction #
This is a quick start tutorial for how to create new Liferay Projects using maven. In this tutorial we will be using the new 2.0 Milestone-1 release of Liferay IDE which includes all of the Eclipse maven plugins (m2e-) that you need to work with Liferay maven projects.
Requirements #
- Eclipse Indigo, Juno, or Kepler
- Liferay IDE 2.0M1 installed into Eclipse
Quick Start Steps #
New Maven Project #
Setup Server
- Launch Eclipse, go to Window-> Properties-> Server-> Runtime Environment-> Add(choose the server's version you need to use, 6.1 or 6.2, select 'Creat a new local server')-> Next(add the server's path)-> Finish
Create liferay maven portlet project
- Go to File-> New-> Project-> Maven, choose Maven Project
- Then Next-> Next, filter the Artifact Id and Version(the version should be as same as your server's version), choose, then Next
- Add Group Id and Artifact Id, then Finish
Resolving POM errors #
After the create project wizard, you could see there is an error in pom.xml file. We need to fix this error.
- Add <properties></properties> tag into pom.xml file
Save the file, then Update project
- Right click project-> Maven-> Update Project->Choose the project-> OK
- You will see error was gone
Check project settings #
- Deployment Assembly Check
- Right click project-> Properties-> Deployment Assembly
- You will see 'Maven Dependencies' in the Source
- If the project doesn't a maven project, it won't be there
- Project Facets check
- Right click project-> Properties-> Project Facets-> Liferay Plugins
- You will see the project's Liferay archetype is selected
- Web Project Settings check
- Right click project-> Properties-> Web Project Settings
- If the project is correctly created, you will see the project type is there
Working with Liferay maven project #
- Start the Server
- When the Server is Started, deploy the project
- Then you will see 'MavenTest-portlet is available for use'in the Console
Create liferay maven theme project
- After the creation, when do the step "Resolving pom errors", open pom.xml file
- You should add these new tags into <properties></properties>
- Save, then Update project, you will see error was gone
- The remaining steps you can do the same like portlet project
Create liferay maven portlet-jsf project
- After the createion, when do the step "Resolving pom errors", you need to do some changes in pom.xml file
- Delete the version 3.1.0-rc2, use the version 3.1.1-ga2 instead of 3.1.0-rc2
- Delete the previous <repositories></repositories> tag
- Add new <repositories></repositories> tag
- Add the <properties></properties> tag like portlet project
- Save, then Update project, you will see error was gone
- The remaining steps you can do the same like portlet project
When create maven Hook, Layout, Servicebuilder,Ext projects, you can do the same steps like portlet project.
27996 Angesehen