You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Phillip Hellewell <ss...@gmail.com> on 2010/10/21 19:40:34 UTC

Classifier now required by assembly plugin

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.  If
my project only produces a single zip, why should I have to worry
about specifying a classifier in all my other poms that depend on this
project?

Thanks,
Phillip

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


RE: Classifier now required by assembly plugin

Posted by "Haszlakiewicz, Eric" <EH...@transunion.com>.
>-----Original Message-----
>From: Phillip Hellewell [mailto:sshock@gmail.com]
>
>On Thu, Oct 21, 2010 at 3:17 PM, Haszlakiewicz, Eric
><EH...@transunion.com> wrote:
>>
>> uh, oh.  We depend on being able to specify that as empty too.  I hope
>this gets fixed before it starts affecting my builds.
>> However, are you sure this is really an issue?  I just tried one of my
>builds which needs an empty <id> element.  I tried using the default
>version of the plugin (2.2-beta-2), and forcing it to the most recent
>version (which appears to be 2.2-beta-5), and it works fine for me.
>> What version are you using?
>
>2.2, which was released a couple weeks ago apparently:
>
>http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-assembly-
>plugin/2.2/

hmm.. weird, the index my Nexus instance isn't picking up this version, so I can't try this out.
Well, if you're sure you're seeing the problem, can you please create a Jira issue for this?  I'll bet we're not the only two people that will be affected by it.

eric  

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


Re: Classifier now required by assembly plugin

Posted by Phillip Hellewell <ss...@gmail.com>.
On Thu, Oct 21, 2010 at 3:17 PM, Haszlakiewicz, Eric
<EH...@transunion.com> wrote:
>
> uh, oh.  We depend on being able to specify that as empty too.  I hope this gets fixed before it starts affecting my builds.
> However, are you sure this is really an issue?  I just tried one of my builds which needs an empty <id> element.  I tried using the default version of the plugin (2.2-beta-2), and forcing it to the most recent version (which appears to be 2.2-beta-5), and it works fine for me.
> What version are you using?

2.2, which was released a couple weeks ago apparently:

http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/2.2/

Phillip

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


RE: Classifier now required by assembly plugin

Posted by "Haszlakiewicz, Eric" <EH...@transunion.com>.
>-----Original Message-----
>From: Phillip Hellewell [mailto:sshock@gmail.com]
>
>On Thu, Oct 21, 2010 at 11:40 AM, Phillip Hellewell <ss...@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.  If
>> my project only produces a single zip, why should I have to worry
>> about specifying a classifier in all my other poms that depend on this
>> project?
>
>This is the error it gives now if I don't have an <id> in my descriptor
>file:
>
>Assembly is incorrectly configured: null
>Assembly: null is not configured correctly: Assembly ID must be
>present and non-empty.
>
>Phillip

uh, oh.  We depend on being able to specify that as empty too.  I hope this gets fixed before it starts affecting my builds.
However, are you sure this is really an issue?  I just tried one of my builds which needs an empty <id> element.  I tried using the default version of the plugin (2.2-beta-2), and forcing it to the most recent version (which appears to be 2.2-beta-5), and it works fine for me.
What version are you using?

eric


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


Re: Classifier now required by assembly plugin

Posted by Phillip Hellewell <ss...@gmail.com>.
On Thu, Oct 21, 2010 at 11:40 AM, Phillip Hellewell <ss...@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.  If
> my project only produces a single zip, why should I have to worry
> about specifying a classifier in all my other poms that depend on this
> project?

This is the error it gives now if I don't have an <id> in my descriptor file:

Assembly is incorrectly configured: null
Assembly: null is not configured correctly: Assembly ID must be
present and non-empty.

Phillip

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


Re: Classifier now required by assembly plugin

Posted by Brian Fox <br...@infinity.nu>.
I'll add comments but I don't think this is a bug.

On Mon, Oct 25, 2010 at 4:23 PM, Phillip Hellewell <ss...@gmail.com> wrote:
> On Mon, Oct 25, 2010 at 11:07 AM, Haszlakiewicz, Eric
> <EH...@transunion.com> wrote:
>>
>> 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.
>
> Thanks Eric.  Now I don't have to create it :)
>
> Phillip
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: Classifier now required by assembly plugin

Posted by Phillip Hellewell <ss...@gmail.com>.
On Mon, Oct 25, 2010 at 11:07 AM, Haszlakiewicz, Eric
<EH...@transunion.com> wrote:
>
> 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.

Thanks Eric.  Now I don't have to create it :)

Phillip

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


Re: Classifier now required by assembly plugin

Posted by Brian Fox <br...@infinity.nu>.
A simple scan of the release notes reveals this was introduced
intentionally by MASSEMBLY-464

On Mon, Oct 25, 2010 at 4:58 PM, Wendy Smoak <ws...@gmail.com> wrote:
> On Mon, Oct 25, 2010 at 1:07 PM, Haszlakiewicz, Eric
> <EH...@transunion.com> wrote:
>>>-----Original Message-----
>>>From: Wendy Smoak [mailto:wsmoak@gmail.com]
>
>>>Have you tried setting appendAssemblyId to false?
>>
>> No, that doesn't help, but thanks for the suggestion.
>
> How so?  If <id> is required (and this is a good thing) then
> appendAssemblyId should keep it out of the filename.
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: Classifier now required by assembly plugin

Posted by Wendy Smoak <ws...@gmail.com>.
On Mon, Oct 25, 2010 at 1:07 PM, Haszlakiewicz, Eric
<EH...@transunion.com> wrote:
>>-----Original Message-----
>>From: Wendy Smoak [mailto:wsmoak@gmail.com]

>>Have you tried setting appendAssemblyId to false?
>
> No, that doesn't help, but thanks for the suggestion.

How so?  If <id> is required (and this is a good thing) then
appendAssemblyId should keep it out of the filename.

-- 
Wendy

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


RE: Classifier now required by assembly plugin

Posted by Martin Gainty <mg...@hotmail.com>.
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<ss...@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
> 
 		 	   		  

Re: Classifier now required by assembly plugin

Posted by John Casey <jd...@commonjava.org>.
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<ss...@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


RE: Classifier now required by assembly plugin

Posted by "Haszlakiewicz, Eric" <EH...@transunion.com>.
>-----Original Message-----
>From: Wendy Smoak [mailto:wsmoak@gmail.com]
>
>On Thu, Oct 21, 2010 at 1:40 PM, Phillip Hellewell <ss...@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


Re: Classifier now required by assembly plugin

Posted by Wendy Smoak <ws...@gmail.com>.
On Thu, Oct 21, 2010 at 1:40 PM, Phillip Hellewell <ss...@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?

-- 
Wendy

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