新建maven项目,建立父工程没有报错,建子工程完了就报错了
CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-artifact-manager:jar:2.0.9, org.apache.maven:maven-monitor:jar:2.0.9, org.apache.maven:maven-toolchain:jar:1.0, org.apache.maven.shared:maven-shared-utils:jar:0.1, com.google.code.findbugs:jsr305:jar:2.0.1, org.apache.maven.shared:maven-shared-incremental:jar:1.1, org.codehaus.plexus:plexus-component-annotations:jar:1.5.5,
org.codehaus.plexus:plexus-compiler-api:jar:2.2, org.codehaus.plexus:plexus-compiler-manager:jar:2.2, org.codehaus.plexus:plexus-compiler-javac:jar:2.2, org.codehaus.plexus:plexus-container-default:jar:1.5.5, org.codehaus.plexus:plexus-classworlds:jar:2.2.2,
org.apache.xbean:xbean-reflect:jar:3.4, log4j:log4j:jar:1.2.12, commons-logging:commons-logging-api:jar:1.1, com.google.collections:google-collections:jar:1.0, junit:junit:jar:3.8.2: Failure to transferorg.apache.maven:maven-artifact-manager:jar:2.0.9 from https://repo.maven.apache.org/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.apache.maven:maven-artifact-manager:jar:2.0.9 from/to central
(https://repo.maven.apache.org/maven2): The operation was cancelled.
鼠标停在红线处就会出现错误的详细信息
网上查了,这种错误一般都是缺少文件,而根据上图报错提示,这次是因为maven本地仓库中缺少maven-resource-plugin:2.6这个相应的依赖文件;
首先在报错项目的pom.xml中输入
<dependencies> <dependency> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.6</version> </dependency> </dependencies>
然后打开cmd在项目的根目录输入: mvn install 自动补全缺失文件
右键报错项目,单击Maven-Update Project 勾选Force Update of Snapshots/Releases这个选项,点击OK按钮,发现错误已经消失。
2.勾选
3.大功告成
.