我收到 Error reading assemblies: No assembly descriptors found
在构建我的项目时。我正在尝试为我的 .sh
设置权限文件并排除令人讨厌的 .jar
使我的应用程序崩溃的文件......但我不认为问题与此有关......
我的 maven-assembly 插件在我的 pom.xml 文件中是这样添加的:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/src.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
我的程序集描述符如下所示:
<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>my-assembly-descriptor</id>
<formats>
<format>jar</format>
<format>war</format>
</formats>
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>${project.build.directory}</outputDirectory>
<includes>
<include>*.sh</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<excludes>
<exclude>spring-2.5.4.jar</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>
我项目中的结构是:
Interface - src - main - assembly - src.xml
- pom.xml
当尝试执行 Run as -> Debug as -> 然后在目标放置时
assembly:single
我犯了同样的错误。我在控制台中尝试过,使用
assembly:assembly
,而我一无所获。我什至试图为我的程序集描述符添加错误的路径,但错误没有改变。当把${basedir}/
在我的程序集描述符的路径之前,我得到了相同的结果。我有 Ubuntu 10.10 Maverick Meerkat,我正在使用 Eclipse EE,...
谢谢!
最佳答案
我一直在用版本 2.3 的 maven-assembly-plugin
,但我相信问题是一样的:如果程序集配置是在执行中声明的,它可以从 mvn package
开始工作。 ,但不适用于 mvn assembly:assembly
.
我找到的解决方案是在插件的顶级配置中声明配置,并保持执行尽可能小:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/standalone.xml</descriptor>
</descriptors>
<finalName>standalone</finalName>
</configuration>
<executions>
<execution>
<id>standalone</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
关于assemblies - 读取程序集 : No assembly descriptors found 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5183460/