Integrate Maven in Liferay development

1. Install Liferay Developer Studio
2. Download maven
3. set maven in your environment
4. configure maven plugins with IDE
1) Help->Eclipse Marketplace->Search, then input “maven”
2) It shows some maven plugins
3) I choose Maven Integration for Eclipse WTP(Incubation), after installed, it looks like this.
5. create Maven project with liferay
1)New->Other-> Maven-> Maven Project
2) The next step is to select the location of our file, I just use default
3) set filter and select “liferay-portlet-archetype”

4) fill “Group Id” and others. Like the photo shows

5) When it’s done, you’ll find there’s a big error on the project. Don’t worry, we’ll figure it out later.

6) Copy “tld” folder from you previous ant project, like this

7) modify web.xml like this

8) modify pom.xml only inside the project’s folder
8.1) change ${liferay.version} to your real liferay version
8.2) modify <autoDeployDir>${liferay.auto.deploy.dir}</autoDeployDir>
to your real liferay deploy dir
9) build project
9.1) Right click the project, then select “Maven Build...”, then it will show the wizard like this
9.2) input “liferay:deploy”in the “Goals”, then click “Apply”, click “Close”, don’t click “Run”
9.3) Then select “Maven Install”, when you see “Build Success”, it’s OK now.
9.4) Then select “Maven Build”. It’s different from the first one.

10) Now every time you make a change and want to test it, you select Maven install from Run As to build the war file and then select Maven build to deploy it to the server.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值