您的位置:首页 > 编程语言 > Java开发

eclipse安装Maven插件M2E

2011-04-02 14:31 357 查看
首先安装tomcat插件:

Tomcat插件下载地址:
http://etc.ecjtu.jx.cn/download/tomcatPluginV32beta3.zip

将插件拷到Eclipse的plugins目录下,解压缩。
在eclipse主目录下新建links目录,
在links目录新建tomcat.link,记事本打开,写入
path=D:/eclipse/plugins/com.sysdeo.eclipse.tomcat_3.2.0.beta3(目录为刚才解压的路径)

重新启动Eclipse,Window-Customize-选中Tomcat,Window-Preferences-设置Tomcat路径,
好了,按小猫按钮启动Tomcat吧

地址:

Nightly builds are available at: http://download.eclipse.org/technology/m2e/updates/N

Milestones builds: http://download.eclipse.org/technology/m2e/updates/M

1:定义Maven为单个用户而不是全局用户。

只需将安装目录下的config/settings.xml复制到.m2目录下即可。

2:如果你想修改settings.xml文件,你可以在项目中创建对该文件的一个link。点击项目-创建文件-选择高级选项-创建该文件的link。

3:设置本地maven仓库的地址:

| The path to the local repository maven will use to store artifacts.
|
| Default: ~/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->

比如。现在我希望我本地仓库为c:/dev/m2repo,那么可以改为

<localRepository>/dev/m2repo</localRepository>

然后运行mvn clean。

4:创建一个简单的maven项目

执行 mvn archetype:create -DgroupId=com.test -DartifactId=mytest

该语句创建一个叫mytest的项目。该项目包括一个com.test的group。

5:从eclipse创建一个maven项目

使用eclipse的External tools。



I created an external tool configuration with the following settings:

Name:mvn archetype~create
Location:C:/dev/apache-maven-2.0.8/bin/mvn.bat
Working Directory:${workspace_loc}
Arguments:archetype:create -DgroupId=${string_prompt:groupId} -DartifactId=${string_prompt:artifactId}


5: (1)手工使用maven创建web项目

mvn archetype:create
-DarchetypeGroupId=org.apache.maven.archetypes
-DarchetypeArtifactId=maven-archetype-webapp
-DarchetypeVersion=1.0
-DgroupId=com.maventest
-DartifactId=mywebtest
-Dversion=1.0-SNAPSHOT
或者(2) 从eclipse创建

Name:mvn archetype~create webapp
Location:C:/dev/apache-maven-2.0.8/bin/mvn.bat
Working Directory:${workspace_loc}
Arguments:archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion=1.0 -DgroupId=${string_prompt:groupId} -DartifactId=${string_prompt:artifactId}
对于有父子关系的项目,必须先install父项目,子项目才能运行
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: