Plugins Maven读取程序集时出错:未找到程序集描述符
接下来我运行了命令Plugins Maven读取程序集时出错:未找到程序集描述符,plugins,maven-2,assemblies,maven-assembly-plugin,Plugins,Maven 2,Assemblies,Maven Assembly Plugin,接下来我运行了命令 mvn assembly:assembly 并获得了的构建失败 Error reading assemblies: No assembly descriptors found. 我看了很多关于这个的问题,但都没有用 从中,我创建了一个.xml,其中包含以下内容: <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http:
mvn assembly:assembly
并获得了的构建失败
Error reading assemblies: No assembly descriptors found.
我看了很多关于这个的问题,但都没有用
从中,我创建了一个.xml
,其中包含以下内容:
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>jar-with-dependencies</id>
<formats>
<format>jar</format>
</formats>
<dependencySets>
<dependencySet>
<scope>runtime</scope>
<unpack>true</unpack>
<unpackOptions>
<excludes>
<exclude>**/LICENSE*</exclude>
<exclude>**/README*</exclude>
</excludes>
</unpackOptions>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>${project.build.outputDirectory}</directory>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
</fileSet>
<fileSet>
<directory>src/main/resources/META-INF/services</directory>
<outputDirectory>META-INF/services</outputDirectory>
</fileSet>
</fileSets>
</assembly>
但还是没有运气
我对这个很陌生,你可能知道,我怎样才能让它运行呢
~~编辑~~
在pom.xml
中,我更改了
<descriptor>jar-with-dependencies.xml</descriptor>
~~编辑3~~~
这个pom.xml
现在适用于我:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/jar-with-dependencies.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
maven汇编插件
2.2-β-5
src/main/assembly/jar-with-dependencies.xml
组装
包裹
单一的
要使其正常工作,您需要在src/main/assembly/
中创建文件jar和dependencies.xml
,该xml:
<descriptors>
<descriptor>src/main/assembly/jar-with-dependencies.xml</descriptor>
</descriptors>
src/main/assembly/jar-with-dependencies.xml
i、 e.您需要指定文件的路径,惯例是将文件放入src/main/assembly/
中
要使用Maven提供的元素,您需要使用descriptorRef
元素(包装在descriptorRefs
中)
另外,不要将描述符放在execution
元素中,或者mvn assembly:assembly
再也找不到它(因为您专门将其移动到mvn包
目标)
[EDIT]我自己也遵循了教程,有一点您可能忽略了:您需要选择正确的原型。在我的例子中,这是
5
,但是顺序可以改变。因此,请阅读整个列表并查找字符串openimaj quickstart原型
,否则会出现问题。我找不到src/assembly/
@MLMLTL您需要创建此文件夹。@MLMLTL:我再次检查了我的一个项目;查看我的编辑。如果您创建了一个自定义XML文件,则需要使用描述符和文件路径(相对于${basedir}
)。同样,还是没有运气——PS
?为什么要使用插件的测试版?最新版本是2.5.3
。试试那个可能的复制品
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/jar-with-dependencies.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/jar-with-dependencies.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<descriptors>
<descriptor>src/main/assembly/jar-with-dependencies.xml</descriptor>
</descriptors>