Maven for Eclipse
2014-07-22 16:40
555 查看
Maven 2 repository
Eclipse needs to know the path to the local maven repository. Therefore the classpath variable M2_REPO has to be set. Execute the following command:mvn -Declipse.workspace=<path-to-eclipse-workspace> eclipse:add-maven-repo
Restart your Eclipse IDE (if you already have it open) for this change to take effect.
You can also define a new classpath variable inside eclipse: From the menu bar, select Window > Preferences. Select the Java > Build Path > Classpath Variables page.
Simple Project
If you have a simple java project which is made up of only one module, using eclipse is very simple. To generate the eclipse project files from your POM you execute the following command:mvn eclipse:eclipse
If you have created or checked out the project with eclipse, you only have to refresh the project in your workspace. Otherwise you have to import the project into your eclipse workspace (From the menu bar, select File >Import >Existing Projects into Workspace). In the latter case the project (directory) should not be located in your workspace, because eclipse might come into trouble, especially if you want to use eclipse as the scm client.
http://maven.apache.org/guides/mini/guide-ide-eclipse.html#Maven_2_repository
PS: 在更新pom后可重新在项目目录下执行
mvn eclipse:eclipse
来重新生成eclipse项目描述文件,然后重启eclipse。
相关文章推荐
- 解决eclipse安装maven的问题:Unable to update index for central|http://repo1.maven.org/maven2
- Eclipse.ini参数设置(Maven Integration for Eclipse JDK Warning)
- 离线安装Maven FOR Eclipse插件
- maven for eclipse在线安装
- maven安装for eclipse kepler
- Maven2 for eclipse plug-in
- 解决安装 maven for eclipse插件后,eclipse启动时警告
- 安装 m2e 插件(maven for eclipse) 插件的最新网址
- Eclipse安装Maven插件Maven Integration for Eclipse
- 解决eclipse安装maven的问题:Unable to update index for central|http://repo1.maven.org/maven2
- Q for Eclipse is an Apache Maven plugin for the Eclipse IDE
- How do I disable maven build when using Maven 2.0 integration for eclipse
- Eclipse安装Maven插件后,Eclipse启动问题:Maven Integration for Eclipse JDK Warning。
- 安装Maven for Eclipse Kepler
- 解决eclipse安装maven的问题:Unable to update index for central|http://repo1.maven.org/maven2
- 解决安装 maven for eclipse插件后,eclipse启动时警告
- Maven Eclipse Plugin vs. Maven Integration for Eclipse
- ssh(maven+jetty)一 (m2e:maven integration for eclipse)
- Maven Integration for Eclipse JDK Warning
- Maven Eclipse (m2e) SCM connector for subclipse 1.10 (svn 1.8)无法