gpt4 book ai didi

java - 无法解析插件 Java Spring

转载 作者:行者123 更新时间:2023-11-30 12:03:32 26 4
gpt4 key购买 nike

我正在使用 IntelliJ IDEA,我尝试通过 maven 安装依赖项,但它给了我这些错误:

Cannot resolve plugin org.apache.maven.plugins:maven-clean-plugin:3.0.0
Cannot resolve plugin org.apache.maven.plugins:maven-resources-plugin:3.0.1
Cannot resolve plugin org.apache.maven.plugins:maven-jar-plugin:3.0.2
Cannot resolve plugin org.apache.maven.plugins:maven-compiler-plugin:3.7.0
Cannot resolve plugin org.apache.maven.plugins:maven-surefire-plugin:2.20.1
Cannot resolve plugin org.apache.maven.plugins:maven-site-plugin:3.6

我搜索过类似的问题,但他们都提到了代理问题,但是,

我可以在没有代理的情况下通过浏览器访问这些插件,我也尝试在 IntelliJ IDEA 中配置代理,但它也不起作用。

日志文件:

java.lang.RuntimeException: org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-site-plugin:3.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-site-plugin:jar:3.6 
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:117)
at org.jetbrains.idea.maven.server.Maven3XServerEmbedder.resolvePlugin(Maven3XServerEmbedder.java:1119)
at jdk.internal.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834) Caused by: java.lang.RuntimeException: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven.plugins:maven-site-plugin:jar:3.6
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:255)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:171)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:250)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:103) ... 17 more Caused by: java.lang.RuntimeException: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-site-plugin:pom:3.6 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.plugins:maven-site-plugin:pom:3.6 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:423)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:225)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:202)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:240) ... 20 more Caused by: java.lang.RuntimeException: org.eclipse.aether.transfer.ArtifactTransferException: Failure to transfer org.apache.maven.plugins:maven-site-plugin:pom:3.6 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.plugins:maven-site-plugin:pom:3.6 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:226)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:192)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:564)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:482)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:400) ... 23 more

error in the image

通过intellij和bash编译构建成功后仍然存在两个错误

Cannot resolve plugin org.apache.maven.plugins:maven-clean-plugin:3.0.0
Cannot resolve plugin org.apache.maven.plugins:maven-site-plugin:3.6

这意味着什么以及如何解决读取依赖项中的剩余错误?

最佳答案

我认为你需要把你的插件放在标签 <build> 中而不是标签 <dependencies> .像这样的东西:

<dependencies>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

查看更多信息 here

关于java - 无法解析插件 Java Spring,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57699705/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com