elharo opened a new issue, #304:
URL: https://github.com/apache/maven-source-plugin/issues/304

   `TestSourceJarMojo.java:28` has `@Execute(phase = "generate-sources")`:
   
   ```java
   @Mojo(name = "test-jar", defaultPhase = "package")
   @Execute(phase = "generate-sources")
   public class TestSourceJarMojo extends TestSourceJarNoForkMojo {
   ```
   
   This is a test-jar goal but forks only to `generate-sources`, not 
`generate-test-sources`. If test sources are generated by another plugin in the 
`generate-test-sources` phase, they will not be available when the mojo runs, 
leading to an empty or incomplete test sources JAR.
   
   Compare with `TestSourceGeneratedJarMojo.java:28` which correctly uses 
`generate-test-sources`:
   
   ```java
   @Mojo(name = "generated-test-jar", defaultPhase = "package")
   @Execute(phase = "generate-test-sources")
   public class TestSourceGeneratedJarMojo extends TestSourceJarNoForkMojo {
   ```
   
   **Fix**: Change the phase to `generate-test-sources`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to