Maven Error reading assemblies: No assembly descriptors found
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.
Comments
-
MLMLTL about 4 years
Following this Guide I ran the command
mvn assembly:assembly
and got the
Build Failure
ofError 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 about 9 yearsI cant find a
src/assembly/
-
Aaron Digulla about 9 years@MLMLTL You need to create this folder.
-
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 about 9 yearsAgain, still no luck -- PS
</descriptor
needs a>
? -
Aaron Digulla about 9 yearsWhy are you using a beta version of the plugin? The latest release is
2.5.3
. Try that -
Aaron Digulla about 9 yearsRun
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 Andhelp:effective-pom
can show you the POM as Maven actually sees it. -
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 about 9 yearsTry
mvn assembly:assembly -X
:-) -
MLMLTL about 9 years
Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta5:assembly (default-cli) ... Error reading assemblies: No assembly descriptors found
-
Aaron Digulla about 9 yearsYou'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 about 9 yearsHow do I check that? I've
cd
'd into the project folder so it should be, right? - With the2.5.3
still no different either. -
Aaron Digulla about 9 yearsHave a look at this: stackoverflow.com/questions/5183460/…
-
MLMLTL about 9 yearsThank You! It was the putting of
<configuration>
above the<executions>
that solved it, submit it as an answer if you like :) -
Aaron Digulla about 9 yearsThe fully qualified name of the class which contains the
main(String[])
method. -
MLMLTL about 9 yearsWhere do I get the
main(String[]) method
name from? -
Aaron Digulla about 9 yearsThe class name should be mentioned in the OpenIMAJ tutorial; isn't there a
pom.xml
in the sources already? -
MLMLTL about 9 yearsI cant see it and there are many poms, inside of which I don't know where to look
-
Aaron Digulla about 9 yearsYou 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 about 9 yearsI dont have a
META-INF/MANIFEST.MF
anywhere -
Aaron Digulla about 9 yearsAny why is that a problem?