using maven and eclipse created a mutiple module project

using maven and eclipse created a mutiple module project

using maven and eclipse created a mutiple module project 

原文网址:blog.donews.com/skyhero/archive/2006/02/16/728702.aspx
Mysn is created as a mutiple module project. It is devided tomysn-model-core,mysn-dao-core,mysn-service-core,and mysn-web-coremodule.This article will show you how to create a multiple moduleproject with maven and eclipse.

System environment
J2SE 5.0
eclipse 3.1.1 with wtp 1.0 plugin.
Maven 2.0
Create the mysn project
Set up a new eclipse workspace called mysn. I set the newly created workspace to "F:myfilemysn".
add the M2_REPO classpath by executing the following command:
mvn -Declipse.workspace=F:myfilemysn eclipse:add-maven-repo
Open the command line shell and change to the newly created workspace directory.
Create a new maven project using the archetype plugin.Execute the following command in command line shell:
mvn archetype:create -DgroupId=cn.org.mysn -DartifactId=mysn
Create a new simple project mysn inside the mysn workspace with eclipse (From the menu bar, select File >New >Project. Select Simple >Project). Eclipse will create a simple .project-file for your mysn project and you should be able to see the pom.xml-file.
Delete the src-folder and open the pom.xml-file to change the packaging of your parent project to pom
<packaging>pom</packaging>


Inside the workspace directory and create some modules.
cd mysnmvn archetype:create -DgroupId=cn.org.mysn.model.core -DartifactId=mysn-model-coremvn archetype:create -DgroupId=cn.org.mysn.dao.core -DartifactId=mysn-dao-coremvn archetype:create -DgroupId=cn.org.mysn.service.core -DartifactId=mysn-service-coremvn archetype:create -DgroupId=cn.org.mysn.web.core -DartifactId=mysn-web-core -DarchetypeArtifactId=maven-archetype-webapp
Note: the mysn-web-core module is created as a webapp project.

Add the newly created modules to your parent pom.
<modules> <module>../mysn-model-core</module> <module>../mysn-dao-core</module> <module>../mysn-service-core</module> <module>../mysn-web-core</module></modules>
Add the parent to the POMs of the new modules:
<parent> <groupId>cn.org.mysn</groupId> <artifactId>mysn</artifactId> <version>1.0-SNAPSHOT</version></parent>
Add dependency from module1 to the mysn-dao-core:
<dependency> <groupId>cn.org.mysn.model.core</groupId> <artifactId>mysn-model-core</artifactId> <version>1.0-SNAPSHOT</version></dependency>
Add dependency from module1 to the mysn-service-core:
<dependency> <groupId>cn.org.mysn.dao.core</groupId> <artifactId>mysn-dao-core</artifactId> <version>1.0-SNAPSHOT</version></dependency>
Add dependency from module1 to the mysn-web-core:
<dependency> <groupId>cn.org.mysn.service.core</groupId> <artifactId>mysn-service-core</artifactId> <version>1.0-SNAPSHOT</version></dependency>
Install the project in your local repository and generate the eclipse files:
mvn installmvn eclipse:eclipse
Open the command line shell and change to the mysn-web-core module directory.generate the eclipse file for mysn-web-core module.
mvn -Dwtpversion=1.0 eclipse:eclipse
reference
Guide to using Eclipse with Maven 2.x
Guide to Webapps
Maven Eclipse plugin - WTP support

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值