maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <mgai...@hotmail.com>
Subject RE: Classifier now required by assembly plugin
Date Tue, 26 Oct 2010 00:51:10 GMT

Casey is correct

<!-- could you please run this execution to verify -->
  <build>
   <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/bin.xml</descriptor>
              </descriptors>
              <appendAssemblyId>true</appendAssemblyId>
            </configuration>
          </execution>
        </executions>
      </plugin>
   </plugins>
</build>

<!-- where the src/main/assembly/bin.xml for zip would look something like -->

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"

  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0
http://maven.apache.org/xsd/assembly-1.1.0.xsd">
  <id>bin</id>
  <formats>
    <format>zip</format>
  </formats>
  <dependencySets>
    <dependencySet>
    <unpack>true</unpack>
    </dependencySet>
  </dependencySets>  
</assembly>

Martin 
______________________________________________ 
please do not alter or disrupt this transmission. thank you




> Date: Mon, 25 Oct 2010 17:24:01 -0400
> From: jdcasey@commonjava.org
> To: users@maven.apache.org
> Subject: Re: Classifier now required by assembly plugin
> 
> Just to be clear, it's been a long-standing bug that the assembly id was 
> NOT required. It's always been the intention to require that element.
> 
> That's why we provided the <appendAssemblyId/> configuration element, to 
> give the user control over whether that id is used to form the 
> coordinate for the resulting artifact.
> 
> This snippet from AbstractAssemblyMojo.java seems to indicate the flag 
> is used correctly. If not, then THAT's the bug, IMO.
> 
> http://pastebin.com/YqEju8EM
> 
>                      if ( attach && destFile.isFile() )
>                      {
>                          if ( isAssemblyIdAppended() )
>                          {
>                              projectHelper.attachArtifact( project, 
> format, assembly.getId(), destFile );
>                          }
>                          else if ( classifier != null )
>                          {
>                              projectHelper.attachArtifact( project, 
> format, classifier, destFile );
>                          }
>                          else if ( !"pom".equals( type ) && 
> format.equals( type ) )
>                          {
>                              if ( !warnedAboutMainProjectArtifact )
>                              {
>                                  final StringBuffer message = new 
> StringBuffer();
> 
>                                  message.append( "Configuration options: 
> 'appendAssemblyId' is set to false, and 'classifier' is missing." );
>                                  message.append( "\nInstead of attaching 
> the assembly file: " )
>                                         .append( destFile )
>                                         .append( ", it will become the 
> file for main project artifact." );
>                                  message.append( "\nNOTE: If multiple 
> descriptors or descriptor-formats are provided for this project, the 
> value of this file will be non-deterministic!" );
> 
>                                  getLog().warn( message );
>                                  warnedAboutMainProjectArtifact = true;
>                              }
> 
>                              final File existingFile = project.getArtifact()
>                                                               .getFile();
>                              if ( ( existingFile != null ) && 
> existingFile.exists() )
>                              {
>                                  getLog().warn( "Replacing pre-existing 
> project main-artifact file: " + existingFile
>                                                                 + 
> "\nwith assembly file: " + destFile );
>                              }
> 
>                              project.getArtifact()
>                                     .setFile( destFile );
>                          }
>                          else
>                          {
>                              projectHelper.attachArtifact( project, 
> format, null, destFile );
>                          }
> 
> 
> On 10/25/10 1:07 PM, Haszlakiewicz, Eric wrote:
> >> -----Original Message-----
> >> From: Wendy Smoak [mailto:wsmoak@gmail.com]
> >>
> >> On Thu, Oct 21, 2010 at 1:40 PM, Phillip Hellewell<sshock@gmail.com>
> >> wrote:
> >>> I just found out the hard way that the latest version of the assembly
> >>> plugin requires an<id>  tag in the descriptor file, which is used
as
> >>> the classifier appended to the zip.
> >>>
> >>> I don't want to specify an id here because then means I have to
> >>> specify a classifier in the dependency section of my other poms.
> >>
> >> Have you tried setting appendAssemblyId to false?
> >
> > No, that doesn't help, but thanks for the suggestion.
> >
> > In my opinion, and probably according to what most people would think is
> > reasonable for *minimal* release between a beta version and a final
> > version, a huge behaviour change like this shouldn't happen.
> >
> > I was finally able to test this with the 2.2 release version, and it
> > fails for me too, so I created a issue in Jira: MASSEMBLY-517.
> >
> > eric
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> 
> -- 
> John Casey
> Developer, PMC Member - Apache Maven (http://maven.apache.org)
> Blog: http://www.johnofalltrades.name/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
 		 	   		  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message