maven-assembly-plugin icon indicating copy to clipboard operation
maven-assembly-plugin copied to clipboard

[MASSEMBLY-477] Add option "failOnMissingClassifierArtifact" for multimodule projects

Open jira-importer opened this issue 15 years ago • 0 comments

Petr Novak opened MASSEMBLY-477 and commented

I have a large multimodule project that needs to create compact distribution files at the root of the modules hierarchy. I want to use the assembly plugin with predefined descriptors for merging submodules classes, sources, tests, resources, configuration, etc. The following descriptor shows the sample of my definition. But there is an issue with usage of <attachmentClassifier>, when used and some submodule does not support this classifier, than the

InvalidAssemblerConfigurationException( "Cannot find attachment with classifier: " + classifier + " in module project: " + project.getId() + ". Please exclude this module from the module-set." ) 

is thrown. It will be great, that the new <failOnMissingClassifierArtifact> could be supported - it is inspired by the sameoption in maven-dependency-plugin: http://maven.apache.org/plugins/maven-dependency-plugin/unpack-dependencies-mojo.html#failOnMissingClassifierArtifact

<moduleSets>
  <moduleSet>
    <includes>
      <include>*-api</include>
    </includes>
    <binaries>
      <attachmentClassifier>sources</attachmentClassifier>
      <failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>      
      <outputDirectory>/</outputDirectory>
      <unpack>true</unpack>  
      <includeDependencies>false</includeDependencies>
    </binaries>
  </moduleSet>
</moduleSets>

At this time I patched the org.apache.maven.plugin.assembly.archive.phase.ModuleSetAssemblyPhase.java to ignore exception and provide only logger.info message.


Affects: 2.2-beta-5

Attachments:

jira-importer avatar Mar 08 '10 01:03 jira-importer