gpt4 book ai didi

Maven 无法执行目标 org.apache.maven.plugins :maven-jar-plugin

转载 作者:行者123 更新时间:2023-12-02 17:02:24 26 4
gpt4 key购买 nike

如下所示,我在运行mvn package时遇到错误

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.3.1:jar (default-jar) on project hello-world: Execution default-jar of goal org.apache.maven.plugins:maven-jar-plugin:2.3.1:jar failed: Unable to load the mojo 'jar' in the plugin 'org.apache.maven.plugins:maven-jar-plugin:2.3.1'. A required class is missing: org/codehaus/plexus/components/io/resources/PlexusIoResourceCollection
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-jar-plugin:2.3.1
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/maven/repository/org/apache/maven/plugins/maven-jar-plugin/2.3.1/maven-jar-plugin-2.3.1.jar
[ERROR] urls[1] = file:/C:/maven/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[2] = file:/C:/maven/repository/org/apache/maven/maven-archiver/2.4.1/maven-archiver-2.4.1.jar
[ERROR] urls[3] = file:/C:/maven/repository/org/codehaus/plexus/plexus-archiver/1.0/plexus-archiver-1.0.jar
[ERROR] urls[4] = file:/C:/maven/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
[ERROR] urls[5] = file:/C:/maven/repository/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.codehaus.plexus.components.io.resources.PlexusIoResourceCollection
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

这是我的 pom.xml。我摆脱了不必要的东西,但仍然不起作用..

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>sds.jetty.simple</groupId>
<artifactId>hello-world</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>Jetty HelloWorld</name>

<properties>
<jettyVersion>8.1.2.v20120308</jettyVersion>
</properties>

<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jettyVersion}</version>
</dependency>
</dependencies>

<build>
</build>
</project>

最佳答案

尝试删除到文件夹

.m2\repository\org\apache\maven\plugins\maven-jar-plugin

在您的文件系统上。您的插件 jar 可能已损坏。

如果这不起作用,请尝试删除 jetty-server 文件夹(相同原因)

关于Maven 无法执行目标 org.apache.maven.plugins :maven-jar-plugin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12364296/

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