Warn when aggregate runs on non-POM packaging - #320
Open
kratos0718 wants to merge 1 commit into
Open
Conversation
AggregatorSourceJarMojo.doExecute() packages sources only for pom packaging and otherwise returns without a word, so a project that reaches the goal with some other packaging gets no source archive and no indication of why. Warn instead, naming the project and its actual packaging, in the style of the classifier warning packageSources already emits.
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.
Fixes #306
Problem
AggregatorSourceJarMojo.doExecute()packages sources only forpompackaging:Any other packaging falls off the end of the method. No archive is produced and nothing is logged, so there is no way to tell the skip apart from a build that simply did not reach the goal.
Fix
Add the
elsebranch and warn, naming the project and its actual packaging so the message says what to change. The wording follows the classifier warningpackageSourcesalready emits.Testing
AggregatorSourceJarMojoTestcovers both branches, overridingpackageSourcesto record the projects it receives rather than building an archive:pompackaging still packages the reactor projects, and logs nothingThe second fails against the silent version with
Wanted but not invoked; the first passes either way, since that branch is unchanged.mvn verify -DskipITs: 12 tests, all passing.