You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Joakim Olsson <jo...@unbound.se> on 2010/10/12 12:42:06 UTC

Problem with maven-assembly-plugin with shared assemblies after upgrading to version 2.2

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

[2] [INFO] File:
/home/jool39/Source/dev/1990/services/webservices/service-service-assurance/base-war-assembly.xml
does not exist.

[3] [INFO] File:
/home/jool39/Source/dev/1990/services/webservices/service-service-assurance/base-war-assembly.xml
does not exist.

Regards,
Joakim

Re: Problem with maven-assembly-plugin with shared assemblies after upgrading to version 2.2

Posted by Joakim Olsson <jo...@unbound.se>.
Aaah...Thanks. I'll try this out tomorrow at work.

Regards,
Joakim


On Mon, Oct 25, 2010 at 6:40 AM, Kevin Calcagno <kc...@lulu.com> wrote:

>
> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Problem with maven-assembly-plugin with shared assemblies after upgrading to version 2.2

Posted by Kevin Calcagno <kc...@lulu.com>.
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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problem with maven-assembly-plugin with shared assemblies after upgrading to version 2.2

Posted by Patrick Aikens <pa...@gmail.com>.
I'm seeing this same problem with a previously working setup.

On Tue, Oct 12, 2010 at 6:42 AM, Joakim Olsson <jo...@unbound.se> 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>
>        <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>
>          <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
>
> [2] [INFO] File:
> /home/jool39/Source/dev/1990/services/webservices/service-service-assurance/base-war-assembly.xml
> does not exist.
>
> [3] [INFO] File:
> /home/jool39/Source/dev/1990/services/webservices/service-service-assurance/base-war-assembly.xml
> does not exist.
>
> Regards,
> Joakim
>



-- 
SELECT * FROM users WHERE clue > 0

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org