Hi,
AMPS supports bundling other plugins into the OBR via the <pluginDependencies> configuration element. However for this to work, the referenced plugin must be added as a dependency of the project.
This is not always desirable, for example if the bundled plugin has a separate API maven module with the plugin exposing the classes from this API module. In this scenario I would like to bundle the plugin, but only add a dependency on the API module to prevent internal classes of the plugin being on the classpath in IDEs.
The current behaviour is this way because GenerateObrArtifactMojo#resolvePluginDependencies only scans the dependency list:
private List<File> resolvePluginDependencies() {
return getMavenContext().getProject().getDependencyArtifacts().stream()
.filter(artifact -> pluginDependencies.contains(
new PluginDependency(artifact.getGroupId(), artifact.getArtifactId())))
.map(Artifact::getFile)
.collect(toList());
}
There are a couple of ways this could be extended:
- The
<dependencyManagement>could be checked as well - The
PluginDependencyclass could be extended so a version etc. could be optionally specified without relying on the project dependencies at all.
Would you be willing to implement this or accept a pull request? Or is there a specific reason why it has been implemented this way?
Thanks,
Jens