# Bundling a plugin in OBR without introducing maven dependency

**URL:** <https://community.developer.atlassian.com/t/bundling-a-plugin-in-obr-without-introducing-maven-dependency/60882>\
**Category:** Confluence Server\
**Tags:** plugin-sdk, amps, plugin-development, confluence-server\
**Created:** [August 23, 2022, 7:43am UTC](https://community.developer.atlassian.com/t/bundling-a-plugin-in-obr-without-introducing-maven-dependency/60882 "2022-08-23T07:43:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jens](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/jens/32/42967_2.png) [@jens](https://community.developer.atlassian.com/u/jens)\
**Post date:** [August 23, 2022, 7:43am UTC](https://community.developer.atlassian.com/t/bundling-a-plugin-in-obr-without-introducing-maven-dependency/60882/1 "2022-08-23T07:43:47Z")

</div>

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](https://bitbucket.org/atlassian/amps/src/7ee115ddea1693e6dfbf76b827a0baddedab431c/amps-maven-plugin/src/main/java/com/atlassian/maven/plugins/amps/osgi/GenerateObrArtifactMojo.java#lines-182) only scans the dependency list:

```java
    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 `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?

Thanks,  
Jens

---

<div class="post-metadata">

**Author:** ![NarendraGhanta](https://avatars.discourse-cdn.com/v4/letter/n/fbc32d/32.png) [@NarendraGhanta](https://community.developer.atlassian.com/u/NarendraGhanta)\
**Post date:** [November 16, 2022, 7:58am UTC](https://community.developer.atlassian.com/t/bundling-a-plugin-in-obr-without-introducing-maven-dependency/60882/3 "2022-11-16T07:58:22Z")

</div>

@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](https://ecosystem.atlassian.net/browse/AMPS-1614)  
we will post our updates in above ticket. at present we are considering it’s a lomg term backlog.
