【发布时间】:2020-10-05 21:38:31
【问题描述】:
我一直在尝试将我的项目从 Java 8 迁移到 Java 11。到目前为止,我还更新了我的 Spring boot 项目,并且能够找到解决问题的方法。虽然对于这个,我在解决它时遇到了一些困难。 我的 Maven 版本是 3.6.1。
一开始我的maven组装插件的值是这样的:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptor>src/main/assembly/boot.xml</descriptor>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
虽然它会抛出一个错误,说明:
目标的执行make-assembly org.apache.maven.plugins:maven-assembly-plugin:3.1.1:single failed: 参数“descriptor”已从插件中删除,请验证 文档。 -> [帮助 1]
根据maven assembly documentation,descriptor 的使用总是不正确的。所以我将其更新为:
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>src/main/assembly/boot.xml</descriptorRef>
</descriptorRefs>
</configuration>
虽然还是不行。它会抛出这样的错误:
读取程序集时出错:带 ID 的描述符 'src/main/assembly/boot.xml' 未找到 -> [帮助 1]
即使 boot.xml 已经存在。
关于如何解决此问题的任何其他建议?提前谢谢!
【问题讨论】:
标签: java spring-boot maven build maven-assembly-plugin