maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Boué (JIRA) <>
Subject [jira] [Commented] (MASSEMBLY-833) Ability to ignore errors about no files to package in assembly
Date Sun, 09 Oct 2016 22:36:20 GMT


Guillaume Boué commented on MASSEMBLY-833:

The attached patch has a side-effect when a JAR assembly is created only with a Manifest.
If the configuration of the Assembly Plugin is:

and the assembly descriptor is simply:

<assembly xmlns=""


Setting the new attribute {{ignoreNoFiles}} to {{true}} results in no assembly being created,
when the JAR should be created, with the Manifest inside. Basically, this corner-case happens
when there are {{ArchiveFinalizer}} that are set on the archiver, and those finalizers would
add files to the assembly.

I think the only good work-around here is to update {{plexus-archiver}} and throw a more specific
exception when no files were set: instead of an {{ArchiverException}}, we could throw a {{EmptyArchiveException}}
that would be a subclass of {{ArchiverException}}. In the Assembly Plugin, this specific exception
can then be catched, and then making the build fail depending on the value {{ignoreNoFiles}}.
If someone doesn't see another way, I'll make an issue for {{plexus-archiver}} with this.

> Ability to ignore errors about no files to package in assembly
> --------------------------------------------------------------
>                 Key: MASSEMBLY-833
>                 URL:
>             Project: Maven Assembly Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.6
>            Reporter: Martin Vehovský
>         Attachments: _MASSEMBLY_833__added_ignoreNoFiles_parameter_allowing_not_to_fail_when_there_are_no_files.patch
>   Original Estimate: 4h
>  Remaining Estimate: 4h
> Motivation: Having extremely large multi-module project, some modules lets call them
"application" modules provide "configuration" files, and they provide them for different environments.
Problem is that not all "application" modules provide "configuration" files for all environments.
In case there are no files available for assembly, the single goal ends up with ERROR:
> Failed to
>  create assembly: Error creating assembly archive <assembly_name>: You must set
at least one file.
> Available workaround is to specify a property to by default skip the assembly execution
and only if there are files for given environment set this property to not skip the given
assembly execution.
> However for large number of environments this solution starts to be messy and hard to
> Do you think that having assembly Parameter "ignoreNoFiles" that will cause to skip the
archive creation for cases there are no files to package seems like reasonable solution?

This message was sent by Atlassian JIRA

View raw message