读取程序集时出错:找不到程序集描述符 [英] Error reading assemblies: No assembly descriptors found

查看:128
本文介绍了读取程序集时出错:找不到程序集描述符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

构建项目时得到Error reading assemblies: No assembly descriptors found.我正在尝试为我的.sh文件设置权限,并排除使我的应用程序崩溃的令​​人讨厌的.jar文件……我不认为问题出在那....

I get Error reading assemblies: No assembly descriptors found when building my project. I'm trying to set permissions for my .sh files and exclude a nasty .jar file that makes my application crash...I don't think the problem is about that though....

我的maven-assembly插件是这样添加到我的pom.xml文件中的:

My maven-assembly plugin is added like this in my pom.xml file:

<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>

我的程序集描述符如下:

My assembly descriptor looks like this:

<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

在尝试以运行方式"->调试方式"->然后进行目标放置时 assembly:single

When trying to do Run as -> Debug as -> and then in goal putting assembly:single

我得到同样的错误.我尝试在控制台中使用assembly:assembly,但一无所获.我什至试图给我的程序集描述符添加错误的路径,但是错误没有改变.当将${basedir}/放在我的程序集描述符的路径之前时,我会得到相同的结果.

I get the same error. I tried in console, with assembly:assembly, and I got nothing. I even tried to put a wrong path to my assembly descriptor, but the error didn't change. When putting ${basedir}/ before the path to my assembly descriptor, I get the same.

我有Ubuntu 10.10 Maverick Meerkat,并且我正在使用Eclipse EE,...

I have Ubuntu 10.10 Maverick Meerkat, and I'm working with Eclipse EE,...

谢谢!

推荐答案

我一直在使用maven-assembly-plugin的版本 2.3 ,但是我相信问题是相同的:如果声明了程序集配置在执行中,它在mvn package中有效,但在mvn assembly:assembly中无效.

I have been using version 2.3 of maven-assembly-plugin, but I believe the problem is the same: if the assembly configuration is declared inside an execution, it works from mvn package, but does not work from mvn assembly:assembly.

我发现的解决方案是在插件的顶级配置中声明配置,并保持执行尽可能小:

The solution I have found is to declare the configuration in the top-level configuration of the plugin, and keep the execution as small as possible:

<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>

这篇关于读取程序集时出错:找不到程序集描述符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆