myeclipse中导入maven

阅读更多
2. myeclipse中使用maven

myeclipse安装插件(由于最新版的Eclipse代号Mars,已经直接集成了Maven,所以无需在安装m2eclipse插件)

打开 Eclipse,点击菜单 Help --> Install NewSoftware 点击 Add 按钮 
Name: m2e
location: http://download.eclipse.org/technology/m2e/releases

配置mvn
window --> preferences --> Maven --> User Settings

新建maven项目
1. Maven --> Maven Project
2. maven-archetype-quickstart 1.1
3. 信息
Group Id: com.andrew.helloworld
Artifact Id: HelloWorld
Version: 0.0.1-SNAPSHOT
Package: com.andrew.helloWorld

配置下载源码:
window --> preferences --> Maven选择
Download Artifact Sources
Download Artifact JavaDoc

运行时将jre改成jdk
window --> preferences --> Java --> Installed JREs

修改pom.xml保存会自动下载
Dependency Hierarchy会显示pom引入的jar包的层次依赖
右键 --> run as
--> Maven clean
--> Maven test 测试

你可能感兴趣的:(maven)