gpt4 book ai didi

java - 为什么我会收到此 Maven 错误?

转载 作者:行者123 更新时间:2023-12-01 09:50:08 24 4
gpt4 key购买 nike

我已经尝试解决这个问题一个小时了,但没有取得任何进展。

当我尝试使用 Maven 编译我的项目时,出现此错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:single (default-cli) on project GankALane: Unable to parse configuration of mojo org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:single for parameter archive: Cannot find setter, adder nor field in org.apache.maven.archiver.MavenArchiveConfiguration for 'descriptorRefs'

我正在使用以下命令进行编译:mvn clean 编译程序集:single

这是我的 pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.me</groupId>
<artifactId>GankALane</artifactId>
<version>1.0-SNAPSHOT</version>

<repositories>
<repository>
<id>beam-releases</id>
<url>https://maven.beam.pro/content/repositories/releases/</url>
</repository>
<repository>
<id>beam-snapshots</id>
<url>https://maven.beam.pro/content/repositories/snapshots/</url>
</repository>

</repositories>

<dependencies>
<dependency>
<groupId>pro.beam</groupId>
<artifactId>api</artifactId>
<version>1.10.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>pro.beam</groupId>
<artifactId>interactive</artifactId>
<version>1.5.0-SNAPSHOT</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.me.GankALane.Main</mainClass>
</manifest>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>

感谢您的关注,希望我能找到解决方案!

最佳答案

你的 POM 是错误的:

<configuration>
<archive>
...
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</archive>
</configuration>

消息给出提示:

parameter archive: Cannot find setter, adder nor field ... for 'descriptorRefs'

参见 Apache Maven Assembly Plugin > Usage :

<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>

还链接到 Apache Maven Archiver开头:无<archive>/<descriptorRefs>那里。

关于java - 为什么我会收到此 Maven 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37647455/

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