因此,我试图在一个随机项目中使用Maven来检查它是如何工作的,当我试图在IntelliJ中构建可执行的jar时,它会给出错误:
Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.4:jar (default-jar) on project lab0_ggcd: Unable to parse configuration of mojo org.apache.maven.plugins:maven-jar-plugin:2.4:jar for parameter addClassPath: Cannot find 'addClassPath' in class org.apache.maven.archiver.ManifestConfiguration
我也尝试过移除.m2/repository,就像很多人说的那样,但是它不起作用。
我的pom.xml看起来像:
....
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClassPath>true</addClassPath>
<classpathPrefix>libs/</classpathPrefix>
<mainClass>
ggcd.Main
</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>项目结构是:

System.out.println.,主类只有一个
发布于 2021-02-24 17:33:59
<addClassPath>应该是<addClasspath>
https://stackoverflow.com/questions/66355840
复制相似问题