Maven Error reading assemblies: No assembly descriptors found

22,016

For this to work, you need to create the file jar-with-dependencies.xml in src/main/assembly/ and this XML:

<descriptors>
    <descriptor>src/main/assembly/jar-with-dependencies.xml</descriptor>
</descriptors>

i.e. you need to specify the path to the file and the convention is to put the files into src/main/assembly/.

To use the ones provided by Maven, you need to use the descriptorRef element instead (wrapped in a descriptorRefs).

Also don't put the descriptor inside of the execution element or mvn assembly:assembly can't find it anymore (since you specifically moved it to the mvn package target).

[EDIT] I followed the tutorial myself and there is an important point which you might have missed: You need to select the correct archetype. In my case, that was 5 but the order can change. So read the whole list and look for the string openimaj-quickstart-archetype or things will break.

Share:
22,016
MLMLTL
Author by

MLMLTL

Please Help Me :'(

Updated on April 01, 2020

Comments

  • MLMLTL
    MLMLTL about 4 years

    Following this Guide I ran the command

    mvn assembly:assembly
    

    and got the Build Failure of

    Error reading assemblies: No assembly descriptors found.
    

    I've looked at numerous questions on this, but to no avail.

    From this post, I created a .xml with this inside:

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

    and included this in the pom.xml:

    <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.2-beta-5</version>
        <configuration>
          <descriptors>
            <descriptor>jar-with-dependencies.xml</descriptor>
            </descriptors>
        </configuration>
      </plugin>
    

    but still no luck.

    I'm pretty new to this as you can probably tell, how can I get this running?

    ~~EDIT~~

    In the pom.xml I changed

    <descriptor>jar-with-dependencies.xml</descriptor>
    

    To

    <descriptor>src/main/assembly/jar-with-dependencies.xml</descriptor>
    

    ~~EDIT 2~~

    pom.xml now contains this:

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

    ~~EDIT 3~~

    This pom.xml now works for me:

    <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>
    
  • MLMLTL
    MLMLTL about 9 years
    I cant find a src/assembly/
  • Aaron Digulla
    Aaron Digulla about 9 years
    @MLMLTL You need to create this folder.
  • Aaron Digulla
    Aaron Digulla about 9 years
    @MLMLTL: I checked again with one of my project; see my edits. If you created a custom XML file, you need to use descriptor and the path to the file (relative to ${basedir}).
  • MLMLTL
    MLMLTL about 9 years
    Again, still no luck -- PS </descriptor needs a >?
  • Aaron Digulla
    Aaron Digulla about 9 years
    Why are you using a beta version of the plugin? The latest release is 2.5.3. Try that
  • Aaron Digulla
    Aaron Digulla about 9 years
    Run mvn -X to get debug output. That should show you the absolute path which the plugin searches. Also check the documentation: maven.apache.org/plugins/maven-assembly-plugin/usage.html And help:effective-pom can show you the POM as Maven actually sees it.
  • MLMLTL
    MLMLTL about 9 years
    No goals have been specified for this build - So added that in (see edit) but is still saying that now
  • Aaron Digulla
    Aaron Digulla about 9 years
    Try mvn assembly:assembly -X :-)
  • MLMLTL
    MLMLTL about 9 years
    Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta5:ass‌​embly (default-cli) ... Error reading assemblies: No assembly descriptors found
  • Aaron Digulla
    Aaron Digulla about 9 years
    You're still using the old version of the plugin. The syntax in EDIT 2 should work. Are you executing Maven in the correct folder?
  • MLMLTL
    MLMLTL about 9 years
    How do I check that? I've cd'd into the project folder so it should be, right? - With the 2.5.3 still no different either.
  • Aaron Digulla
    Aaron Digulla about 9 years
  • MLMLTL
    MLMLTL about 9 years
    Thank You! It was the putting of <configuration> above the <executions> that solved it, submit it as an answer if you like :)
  • Aaron Digulla
    Aaron Digulla about 9 years
    The fully qualified name of the class which contains the main(String[]) method.
  • MLMLTL
    MLMLTL about 9 years
    Where do I get the main(String[]) method name from?
  • Aaron Digulla
    Aaron Digulla about 9 years
    The class name should be mentioned in the OpenIMAJ tutorial; isn't there a pom.xml in the sources already?
  • MLMLTL
    MLMLTL about 9 years
    I cant see it and there are many poms, inside of which I don't know where to look
  • Aaron Digulla
    Aaron Digulla about 9 years
    You probably chose the wrong archetype when creating the tutorial. Make sure you chose openimaj-quickstart-archetype when Maven asks which archetype you want (first question).
  • MLMLTL
    MLMLTL about 9 years
    I dont have a META-INF/MANIFEST.MF anywhere
  • Aaron Digulla
    Aaron Digulla about 9 years
    Any why is that a problem?