# Add dependencies to a \`MavenPublication\` / \`IvyPublication\`

**URL:** <https://discuss.gradle.org/t/add-dependencies-to-a-mavenpublication-ivypublication/40062>\
**Category:** Help/Discuss\
**Created:** [May 25, 2021, 8:12pm UTC](https://discuss.gradle.org/t/add-dependencies-to-a-mavenpublication-ivypublication/40062 "2021-05-25T20:12:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve\_Ebersole](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/steve_ebersole/32/9763_2.png) [@Steve\_Ebersole](https://discuss.gradle.org/u/Steve_Ebersole)\
**Post date:** [May 25, 2021, 8:12pm UTC](https://discuss.gradle.org/t/add-dependencies-to-a-mavenpublication-ivypublication/40062/1 "2021-05-25T20:12:56Z")

</div>

I am working on a plugin that gets applied to a project which applies neither the `java` nor `java-library` plugin. Long back-story, but the gist is that the standard tasks added by each “get in the way” of what this plugin does.

So I have a project that is not a Java project as far as Gradle sees.

The plugin does however set up publications. In this respect I want the project to operate “as if” it were a Java project in terms of what gets published. I have most of this working, however the one piece that I cannot figure out is how to add dependencies to the publications.

Any pointers on how to achieve this manually? Aside from editing the XML ofc 😉

[How to manually add dependencies to Gradle's MavenPom/MavenPublication? - Stack Overflow](https://stackoverflow.com/questions/67704889/how-to-manually-add-dependencies-to-gradles-mavenpom-mavenpublication) for points on SO also
