assemblies - 读取程序集 : No assembly descriptors found 时出错

标签 assemblies maven-assembly-plugin

我收到 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/

相关文章:

.net - 将发布者策略嵌入到程序集中

c# - 如何在不破坏应用程序引用的情况下从部署项目中重新定位程序集?

c# - 加载外部程序集时的最佳实践

maven - 如何测试 Maven 程序集目录的内容是否正确?

java - 运行 jar 时无法将资源作为流读取

maven-2 - 带有依赖项的 jar Maven 程序集

ASP.Net 无法创建/卷影副本

c# - 在程序集的命名空间内循环?

Maven 程序集插件未在解压缩的依赖项集上应用 fileMode

java - 打包 jar 时 Maven 无法检索 buildNumber