Error reading assemblies: No assembly descriptors found

Luli picture Luli · Mar 3, 2011 · Viewed 56.9k times · Source

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

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>

The structure in my project is:

Interface - src - main - assembly - src.xml

          - pom.xml

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

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.

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

Thanks!

Answer

edrabc picture edrabc · Nov 15, 2012

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>