kratos0718 opened a new pull request, #320:
URL: https://github.com/apache/maven-source-plugin/pull/320
Fixes #306
### Problem
`AggregatorSourceJarMojo.doExecute()` packages sources only for `pom`
packaging:
```java
protected void doExecute() throws MojoException {
if (Type.POM.equals(getProject().getPackaging().type().id())) {
packageSources(reactorProjects);
}
}
```
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 `else` branch and warn, naming the project and its actual packaging
so the message says what to change. The wording follows the classifier warning
`packageSources` already emits.
### Testing
`AggregatorSourceJarMojoTest` covers both branches, overriding
`packageSources` to record the projects it receives rather than building an
archive:
- `pom` packaging still packages the reactor projects, and logs nothing
- non-POM packaging packages nothing and warns, with the message naming the
packaging and the project
The 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.
- [x] I hereby declare this contribution to be licenced under the [Apache
License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0)
--
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]