Bundling a plugin in OBR without introducing maven dependency


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())))

There are a couple of ways this could be extended:

  • The <dependencyManagement> could be checked as well
  • The PluginDependency class 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?


1 Like

@jens thanks for raising this requirement, we will do the feasibility study on it and get back to you with time lines based on tangible parameters.

for our tracking purpose created this ticket under AMPS project, [AMPS-1614] - Ecosystem Jira
we will post our updates in above ticket. at present we are considering it’s a lomg term backlog.

1 Like