遇到了一些问题:
1[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources (default-resources) on project example:
Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources failed:
Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved:
Failed to collect dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.5 ():
Failed to read artifact descriptor for org.apache.maven:maven-plugin-descriptor:jar:2.0.6:
解决方案:
原来 Eclipse 里的 Maven 会去读 User Home 里的 Maven 配置文件 settings.xml,预设是没有这个文档的,所以会使用默认的位置 User Home/.m2/repository。
只要在上图修改 settings.xml 到想要的位置,或者去修改 User Home/.m2/settings.xml。
这里我选择了从maven 官网下载下来的包中的配置文件
settings.xml 配置文件里面有个 localRepository 标签,更改你想要的地址就可以了。
2Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin
解决方案:
1.) add dependency to pom.xml
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
</dependency>
2.) run mvn install
from Eclipse or from command line
3.) refresh the project in eclipse (F5)
4.) run Maven > Update Project Configuration...
on project (right click)
maven2 was cached in the local repository, resolution will not be reattempted until the update interval
of central has elapsed or updates are forced. Original error: Could not transfer artifact
org.sonatype.forge:forge-parent:pom:10 from/to central (http://repo.maven.apache.org/maven2):
connection timed out to http://repo.maven.apache.org/maven2/org/sonatype/forge/forge-parent/10/
forge-parent-10.pom
解决方案:
修改dependencies
学习文档:
http://www.cnblogs.com/sschen/p/3664479.html
http://stackoverflow.com/questions/8834806/m2eclipse-error