Eclipse 中使用 Maven
原文:使用 Eclipse 构建 Maven 项目 (step-by-step)
安装 m2eclipse 插件时出错:
txtCannot complete the install because one or more required items could not be found. Software being installed: m2e - Maven Integration for Eclipse (includes Incubating components) 1.7.0.20160603-1933 (org.eclipse.m2e.feature.feature.group 1.7.0.20160603-1933) Missing requirement: Maven Integration for Eclipse 1.7.0.20160603-1933 (org.eclipse.m2e.core 1.7.0.20160603-1933) requires 'bundle org.eclipse.osgi 3.10.0' but it could not be found Cannot satisfy dependency: From: Maven Integration for Eclipse (Editors) 1.7.0.20160603-1933 (org.eclipse.m2e.editor 1.7.0.20160603-1933) To: bundle org.eclipse.m2e.core [1.7.0,1.8.0) Cannot satisfy dependency: From: m2e - Maven Integration for Eclipse (includes Incubating components) 1.7.0.20160603-1933 (org.eclipse.m2e.feature.feature.group 1.7.0.20160603-1933) To: org.eclipse.m2e.editor [1.7.0.20160603-1933]
根据 Maven in Eclipse: step by step installation 里的回答,好像是因为 Eclipse 不支持最新版本的 m2e 导致的,试了下 1.4-最新的 1.7 都不行,就先安装了 1.0 版的 (http://download.eclipse.org/technology/m2e/milestones/1.0).
Eclipse 使用 Maven 创建 Web 时错误:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webap
Maven build 时出错(
-Dmaven.multiModuleProjectDirectory
system propery is not set. Check$M2_HOME
environment variable and mvn script match.)在 Window->Preference->Java->Installed JREs->Edit 的 Default VM arguments 中设置
bash-Dmaven.multiModuleProjectDirectory=$M2_HOME
Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its depende
好像是以为之前配的 setting.xml 里的 mirror 里没有对应的插件导致的。把 mirror 删掉就好了。
运行 Maven 是报错:
No goals have been specified for this build
pom.xml 文件
<build>
标签后面加上<defaultGoal>compile</defaultGoal>
即可