With 2.2, the value of a 'descriptor' element is interpreted strictly as a
file name relative to ${basedir}. To call your shared assemblies in 2.2,
use 'descriptorRefs' instead of 'descriptors' and drop the '.xml' file
extension. (This is also how one calls built-in descriptors like
'jar-with-dependencies' and 'bin'.) So, to adjust your example:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>make-base-war</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.somegroup</groupId>
<artifactId>build-tools</artifactId>
<version>${build.tools.version}</version>
</dependency>
</dependencies>
<configuration>
<descriptorRefs>
<descriptorRef>base-war-assembly</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
The 2.2-beta-5 code included a locator strategy for descriptors that looked
under the 'assemblies' directory on the classpath. This appears to have
been an intentional change (and is cleaner this way, IMHO). If you're
curious, compare the class
org.apache.maven.plugins.assembly.io.DefaultAssemblyReader between the
2.2-beta-5 and 2.2 tags.
Unsolicited extra bonus tips:
- Shared assemblies can also be picked up from a build extension rather than
just a declared dependency of the plugin.
- If what you're looking to do (inferring from the name of your execution
here) is stitch together pieces of WARs, consider using the overlay feature
of the WAR plugin itself.
--Kevin
Joakim Olsson wrote:
>
> Hi,
>
> I have a problem using shared assemblies after upgrading from version
> 2.2-beta-5 to the newly released version 2.2.
>
> This is my configuration:
> <plugin>
> <artifactId>maven-assembly-plugin</artifactId>
> <version>2.2-beta-5</version>
> <!-- [snip] -->
> <configuration>
> <descriptors>
> <descriptor>base-war-assembly.xml</descriptor>
> </descriptors>
> </configuration>
> </plugin>
>
> The error I get after upgrading to version 2.2 is:
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Error reading assemblies: Error locating assembly descriptor:
> base-war-assembly.xml
>
> [1] [INFO] Searching for file location:
> /home/jool39/Source/dev/1990/services/webservices/service-service-assurance/base-war-assembly.xml
>
> [snip]
>
> Regards,
> Joakim
>
>
--
View this message in context:
http://maven.40175.n5.nabble.com/Problem-with-maven-assembly-plugin-with-shared-assemblies-after-upgrading-to-version-2-2-tp3208708p3234946.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]