Fork test-jar to generate-test-sources - #319
Closed
kratos0718 wants to merge 1 commit into
Closed
Conversation
TestSourceJarMojo packages test sources but forked only to generate-sources. Test sources contributed by another plugin bound to generate-test-sources therefore did not exist yet when the mojo ran, and were missing from the test-sources jar. TestSourceGeneratedJarMojo, which packages the same content, already forks to generate-test-sources. Fork to generate-test-sources. That phase comes later in the default lifecycle, so everything the previous fork covered is still covered. The test-jar IT only generated sources in generate-sources, so it passed either way. Add a generate-test-sources execution mirroring the one the test-jar-generated IT already uses, and assert its output is in the jar.
Contributor
Author
|
Closing — #316 was already open for this and I missed it before starting. Apologies for the duplicate noise. For whatever it is worth, the one thing here that is not in #316 is that the existing |
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 #304
Problem
TestSourceJarMojopackages test sources, but forks only togenerate-sources:Test sources contributed by another plugin bound to
generate-test-sourcesdo not exist yet when the mojo runs, so they are missing from the test-sources jar.TestSourceGeneratedJarMojopackages the same content and already forks togenerate-test-sources.Fix
Fork to
generate-test-sources. It comes later in the default lifecycle, so everything the previous fork covered is still covered — the change only widens the forked build.Testing
The
test-jarIT only generated sources ingenerate-sources, so it passed either way and did not pin the fork phase. It now also has agenerate-test-sourcesexecution and asserts that its output reaches the jar, mirroring what thetest-jar-generatedIT already does forgenerated-test-jar.Against the current
generate-sourcesfork the extended IT fails on exactly that entry, with the rest of the jar intact:The build plan shows the cause — the forked build stops before the new execution:
With the fix,
test-jar,test-jar-generated,test-jar-no-forkandtest-jar-classifierall pass, along with the 10 unit tests. Run on Maven 4.0.0-beta-3.