[MASSEMBLY-896] Allow configuring assembly descriptors via property - #1346
Merged
Conversation
wilx
marked this pull request as ready for review
July 30, 2026 14:52
Expose descriptors through assembly.descriptors for command-line use. Cover multiple comma-separated descriptor paths with an integration test. Fixes apache#1105
There was a problem hiding this comment.
Pull request overview
Exposes the existing descriptors Mojo parameter as a CLI/user property (assembly.descriptors) so callers can select one or more custom assembly descriptor files when invoking assembly:single without modifying a project’s POM.
Changes:
- Bind
descriptorsto theassembly.descriptorsuser property via@Parameter(property = "assembly.descriptors"). - Add a new integration test project that passes two descriptor paths via a single comma-separated property value.
- Verify each descriptor produces a distinct ZIP with the expected content.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/org/apache/maven/plugins/assembly/mojos/AbstractAssemblyMojo.java | Exposes descriptors as the assembly.descriptors user property for CLI configuration. |
| src/it/projects/mojo-configuration/descriptorsCLIProperty/pom.xml | IT project POM to run the assembly plugin without POM descriptor configuration. |
| src/it/projects/mojo-configuration/descriptorsCLIProperty/invoker.properties | Runs maven-assembly-plugin:single directly as the IT goal. |
| src/it/projects/mojo-configuration/descriptorsCLIProperty/test.properties | Supplies assembly.descriptors as a comma-separated list of descriptor paths. |
| src/it/projects/mojo-configuration/descriptorsCLIProperty/verify.groovy | Asserts both expected ZIPs are produced and contain the expected entries. |
| src/it/projects/mojo-configuration/descriptorsCLIProperty/src/assembly/first.xml | First descriptor producing a ZIP containing first.txt. |
| src/it/projects/mojo-configuration/descriptorsCLIProperty/src/assembly/second.xml | Second descriptor producing a ZIP containing second.txt. |
| src/it/projects/mojo-configuration/descriptorsCLIProperty/first.txt | Test input file included by the first descriptor. |
| src/it/projects/mojo-configuration/descriptorsCLIProperty/second.txt | Test input file included by the second descriptor. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
slawekjaranowski
approved these changes
Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expose the
descriptorsMojo parameter as theassembly.descriptorsuserproperty. This allows custom assembly descriptors to be selected when invoking
assembly:singledirectly from the command line.Maven converts a comma-separated property value to the existing
String[]parameter. The integration test supplies two descriptor paths through one user
property and verifies the archive produced by each descriptor.
Fixes #1105
Validation
mvn verifywith Maven 3.9.16 and JDK 21: 268 tests passed.mvn -Prun-its verifywith Maven 3.9.16 and JDK 21: 151 Invoker builds passed.Following this checklist to help us incorporate your
contribution quickly and easily:
Note that commits might be squashed by a maintainer on merge.
This may not always be possible but is a best-practice.
mvn verifyto make sure basic checks pass.A more thorough check will be performed on your pull request automatically.
mvn -Prun-its verify).If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.