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:wsm...@gmail.com]

On Thu, Oct 21, 2010 at 1:40 PM, Phillip Hellewell<ssh...@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-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org


--
John Casey
Developer, PMC Member - Apache Maven (http://maven.apache.org)
Blog: http://www.johnofalltrades.name/

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

Reply via email to