Plugin ‘org.apache.maven.plugins:maven-compiler-plugin:‘ not found报错

发布于:2024-11-27 ⋅ 阅读:(76) ⋅ 点赞:(0)

场景:处理完冲突报错

代码:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>

无论如何更新maven都报错

org.jboss:jboss-parent:pom:39 failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.jboss:jboss-parent:pom:39 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/146.75.112.215] failed: Connect timed out

Try to run Maven import with -U flag (force update snapshots)

检查配置文件,都是正确的

解决:去本地仓库找到并查看对应的版本,然后加上对应版本,例如:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
<version>3.1</version>
</configuration>
</plugin>

然后更新maven,不报错了,这时候删除这个版本号也不会报错了