You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Johannes Ernst <jo...@gmail.com> on 2015/05/10 02:03:27 UTC

[WARNING] Configuration options: 'appendAssemblyId' is set to false, and 'classifier' is missing.

A couple of days I asked about how to “roll up” several maven projects into a new one, as if the old ones had never existed. Didn’t get a reply though.

Reviewing the source code for AbstractAssemblyMojo, I found that if I set

    appendAssemblyId=false

(default is true, and this @Parameter does not seem to be documented on the website), I get the behavior I want.

Plus the above warning. Here it is in its full glory:

    [WARNING] Configuration options: 'appendAssemblyId' is set to false, and 'classifier' is missing.
    Instead of attaching the assembly file: xxx.jar, it will become the file for main project artifact.
    NOTE: If multiple descriptors or descriptor-formats are provided for this project, the value of this file will be non-deterministic!

Which in my case, is entirely unnecessary because I only have one. And I think my use of the plugin is useful :-)

Can I suggest the following modification of the code, in AbstractAssemblyMojo.execute()

    <strike> boolean warnedAboutMainProjectArtifact = false;
    <insert> int numberMainArtifactReplacers = 0;

    for ( final Assembly assembly : assemblies )
    {
        …
        for ( final String format : effectiveFormats )
            …
            … (long if-then-else)
            else if ( !"pom".equals( type ) && format.equals( type ) )
            {
                <strike> if ( !warnedAboutMainProjectArtifact )
                <insert> if( numberMainArtifactReplacers > 1 ) 
                {
                    … emit above warning

                    <strike>warnedAboutMainProjectArtifact = true;
                    <insert>++ numberMainArtifactReplacers;

and perhaps, upgrade the warning to an error because it now only gets emitted if there indeed will be a conflict.

And some documentation on the website that says this can be done.

Now, shoot, and tell me what this is a bad idea! :-) 

Cheers,



Johannes.


Johannes Ernst
Blog: http://upon2020.com/ <http://upon2020.com/>
Twitter: @Johannes_Ernst
GPG key: http://upon2020.com/public/pubkey.txt <http://upon2020.com/public/pubkey.txt>
Check out UBOS, the Linux distro for personal servers: http://ubos.net/ <http://ubos.net/>