# Gradle plugin packaged by Maven

**URL:** <https://discuss.gradle.org/t/gradle-plugin-packaged-by-maven/47289>\
**Category:** Help/Discuss\
**Created:** [December 20, 2023, 12:38am UTC](https://discuss.gradle.org/t/gradle-plugin-packaged-by-maven/47289 "2023-12-20T00:38:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Boyko](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@Alex\_Boyko](https://discuss.gradle.org/u/Alex_Boyko)\
**Post date:** [December 20, 2023, 12:38am UTC](https://discuss.gradle.org/t/gradle-plugin-packaged-by-maven/47289/1 "2023-12-20T00:38:20Z")

</div>

Hi all,

I’m trying to implement a Gradle plugin in Java but using Maven to build and publish plugin as opposed to example Gradle plugins using Gradle.

Dependencies. Gradle plugin built with Gradle usually has just one dependency `implementation(gradleApi())` that brings all of gradle core libs from the gradle version used by the project. If I use maven to build the project i have to bring in a number of `org.gradle:gradle-xxx-xxx` dependencies found in the repo: [JFrog](https://repo.gradle.org/gradle/libs-releases). The issue is that all these libs have 6.1.1 version as the latest in the repo. Does this look right? I was under the impressions that it should be 8.5

Publishing. Is it possible to publish a Gradle plugin artifact built with Maven to the Gradle Plugin Portal?

It’d be awesome if you could point me an example of a Gradle plugin built with Maven somewhere in Github 🙂

Thanks in advance!

Cheers,  
Alex

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [December 20, 2023, 9:38am UTC](https://discuss.gradle.org/t/gradle-plugin-packaged-by-maven/47289/2 "2023-12-20T09:38:42Z")

</div>

`gradleApi(...)` is not an external dependency but a shipped thing built into the Gradle distribution.

Once this issue is resolved it might be available as external dependency: [Improved support for plugins targeting multiple Gradle versions · Issue #70 · gradle/build-tool-roadmap · GitHub](https://github.com/gradle/build-tool-roadmap/issues/70)

In the meantime you might want to use the repackaged jars from [Gradle plugin development](https://docs.nokee.dev/manual/gradle-plugin-development.html#sec:gradle-dev-redistributed-gradle-api) as your dependency.

Publishing to the portal is probably problematic. The only way I know is the closed source obfuscated Gradle plugin. Maybe with enough effort your somehow could abuse it, but no idea.

You could just publish to Maven Central, as the portal delegates to it for things it does not host itself, but you will then not find it on the web frontend of the portal.

In any way, don’t forget to also build and publish the marker artifact, or using the plugin is much harder than it should be: [Using Plugins](https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_markers)

It is probably much easier if you use Gradle to build and publish your plugin module and delegate from Maven to Gradle if you insist on using Maven as primary build tool, especially if you want to publish to the portal directly.

---

<div class="post-metadata">

**Author:** ![Alex\_Boyko](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@Alex\_Boyko](https://discuss.gradle.org/u/Alex_Boyko)\
**Post date:** [December 20, 2023, 4:26pm UTC](https://discuss.gradle.org/t/gradle-plugin-packaged-by-maven/47289/3 "2023-12-20T16:26:16Z")

</div>

Thank you very much!!!
