[ 
https://issues.apache.org/jira/browse/MASSEMBLY-833?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16181316#comment-16181316
 ] 

Nicholas DiPiazza edited comment on MASSEMBLY-833 at 9/26/17 6:52 PM:
----------------------------------------------------------------------

I have the following assembly

{code}
<assembly>
    <id>plugin</id>
    <formats>
        <format>zip</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <dependencySets>
        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <scope>runtime</scope>
            <outputDirectory>lib</outputDirectory>
            <includes>
                <include>*:jar:*</include>
            </includes>
        </dependencySet>
    </dependencySets>
    <fileSets>
        <fileSet>
            <directory>target/plugin-classes</directory>
            <outputDirectory>classes</outputDirectory>
        </fileSet>
    </fileSets>
</assembly>
{code}

and

{code}
<plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <descriptors>
                        <descriptor>
                            src/main/assembly/assembly.xml
                        </descriptor>
                    </descriptors>
                    <appendAssemblyId>false</appendAssemblyId>
                    <excludeScope>provided</excludeScope>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attached</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
{code}

In my maven pom in many of my projects I have only "provided" dependencies. But 
in other projects I have provided and a few compile dependencies. 

In the ones with only provided dep's I get: *Failed to create assembly: Error 
creating assembly archive plugin: You must set at least one file.*

Does this patch fix this? If so, what version of Maven has it? 


was (Author: ndipiazza_gmail):
I have the following assembly

{code}
<assembly>
    <id>plugin</id>
    <formats>
        <format>zip</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <dependencySets>
        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <scope>runtime</scope>
            <outputDirectory>lib</outputDirectory>
            <includes>
                <include>*:jar:*</include>
            </includes>
        </dependencySet>
    </dependencySets>
    <fileSets>
        <fileSet>
            <directory>target/plugin-classes</directory>
            <outputDirectory>classes</outputDirectory>
        </fileSet>
    </fileSets>
</assembly>}}

and

{{
<plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <descriptors>
                        <descriptor>
                            src/main/assembly/assembly.xml
                        </descriptor>
                    </descriptors>
                    <appendAssemblyId>false</appendAssemblyId>
                    <excludeScope>provided</excludeScope>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attached</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
{code}

In my maven pom in many of my projects I have only "provided" dependencies. But 
in other projects I have provided and a few compile dependencies. 

In the ones with only provided dep's I get: *Failed to create assembly: Error 
creating assembly archive plugin: You must set at least one file.*

Does this patch fix this? If so, what version of Maven has it? 

> Ability to ignore errors about no files to package in assembly
> --------------------------------------------------------------
>
>                 Key: MASSEMBLY-833
>                 URL: https://issues.apache.org/jira/browse/MASSEMBLY-833
>             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 maintain.
> 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
(v6.4.14#64029)

Reply via email to