Hello I am trying to create a custom descriptor ref in my parent pom which packages all dependencies with sources. I got the assembly.xml nailed down pretty well, but when I add it to my base POM assembly:assembly fails like so:
[INFO] [assembly:assembly]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error reading assemblies: No assembly descriptors found.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error reading assemblies: No assembly descriptors found.
But assembly:single seems to work correctly. I've tried adding the jar-with-dependencies ref into the POM as well, but I am not sure if this is even possible.
Here is what I have in my base pom:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-3</version>
<dependencies>
<dependency>
<groupId>mycompany.jar.assembly</groupId>
<artifactId>jar-with-dependencies-and-sources-test</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
Does anyone out there know who to get this to work when I invoke mvn assembly:assembly from the command line?
Thanks in advance.
The Assembly Plugin for Maven enables developers to combine project output into a single distributable archive that also contains dependencies, modules, site documentation, and other files. Your project can easily build distribution "assemblies" using one of the prefabricated assembly descriptors.
Defines the rules for matching and working with files in a given base directory. Element.
The default location of assemblies. xml is in the project root directory.
bin. Use bin as the descriptorRef of your assembly-plugin configuration in order to create a binary distribution archive of your project. This built-in descriptor produces an assembly with the classifier bin in three archive formats: tar.
I'm not sure, but I have a suspicion. You define assembly:single as part of the package phase, and identify the descriptor there in the execution element. This may mean the plugin doesn't know where to look for the descriptor when you run assembly:assembly. Try copying your <configuration>
element to outside of the <executions>
element.
One of my poms looks like this, and I use assembly:assembly all the time:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.1</version>
<configuration>
<finalName>myJar</finalName>
<descriptors>
<descriptor>src/main/config/descriptor.xml</descriptor>
</descriptors>
<archive>
<manifest>
<mainClass>org.foo.Bar</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
Note src/main/config
isn't a Maven standard path, but I haven't defined any special handling of it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With