# Com.gradle.plugin-publish does not respect new Java Library configurations

**URL:** <https://discuss.gradle.org/t/com-gradle-plugin-publish-does-not-respect-new-java-library-configurations/24041>\
**Category:** Help/Discuss\
**Tags:** plugins\
**Created:** [September 11, 2017, 8:50pm UTC](https://discuss.gradle.org/t/com-gradle-plugin-publish-does-not-respect-new-java-library-configurations/24041 "2017-09-11T20:50:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkobit](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/mkobit/32/7217_2.png) [@mkobit](https://discuss.gradle.org/u/mkobit)\
**Post date:** [September 11, 2017, 8:50pm UTC](https://discuss.gradle.org/t/com-gradle-plugin-publish-does-not-respect-new-java-library-configurations/24041/1 "2017-09-11T20:50:38Z")

</div>

`implementation` dependencies are not included in the generated POM when uploaded to the the plugin portal. I looked at the byte code and the `DependenciesBuilder.buildMavenDependencies(ConfigurationContainer configurations)` only uses `compile` and `runtime` configurations.

It is painful to figure these issues out as well because the plugin does not publish its sources or Javadoc. This bug and [com.gradle.publish.PluginBundleExtension usability issue for Gradle Kotlin DSL](https://discuss.gradle.org/t/com-gradle-publish-pluginbundleextension-usability-issue-for-gradle-kotlin-dsl/23740) are only a few of the issues I have ran into while trying to publish a plugin to the portal. Using the [`java-gradle-plugin`](https://docs.gradle.org/current/userguide/javaGradle_plugin.html) is much simpler and straight forward. It would be useful to see the plugins converge, and hopefully see it be in open source as well because the last publish was in December.

---

<div class="post-metadata">

**Author:** ![eljobe](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/eljobe/32/4290_2.png) [@eljobe](https://discuss.gradle.org/u/eljobe)\
**Post date:** [September 12, 2017, 8:46am UTC](https://discuss.gradle.org/t/com-gradle-plugin-publish-does-not-respect-new-java-library-configurations/24041/2 "2017-09-12T08:46:53Z")

</div>

@mkobit,

Thanks for reporting this issue. It’s actually one we’re actively working on and hope to have a fix for complete with a new release of the publish-plugin sometime this week or next.

---

<div class="post-metadata">

**Author:** ![mkobit](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/mkobit/32/7217_2.png) [@mkobit](https://discuss.gradle.org/u/mkobit)\
**Post date:** [September 12, 2017, 2:58pm UTC](https://discuss.gradle.org/t/com-gradle-plugin-publish-does-not-respect-new-java-library-configurations/24041/3 "2017-09-12T14:58:28Z")

</div>

Thanks Pepper for the quick response and also for working on a new version.

I’ve been working on releasing the first version of [https://github.com/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin](https://github.com/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin) (a plugin written in Kotlin) to the plugin portal, but have ran into some issues so it may be a good candidate to include in whatever tests you are doing. Here are some of the things I’ve observed and tried with the plugin repository and an example consumer repository.

1. Gradle test kit tests work using `withPluginClasspath` and the `java-library-plugin` for most of the `build.gradle` use cases I have tested (one issue with `build.gradle.kts` tests, but seems unrelated)

2. When using `maven-publish`, running `publishToMavenLocal` and consuming from my local `.m2` repository using the following `pluginManagement` in consumer can apply the plugin successfully (haven’t tried using it too much)

3. Running `publishPlugins` (after changing to `compile` dependencies for now) I see:

4. Consuming the newly published plugin (see example code here [https://github.com/mkobit/jenkins-pipeline-shared-library-example](https://github.com/mkobit/jenkins-pipeline-shared-library-example)) results in:

5. Running `buildEnvironment` task in the consumer doesn’t seem right:

I’ve been abusing [PLUGIN AUTHORS: You can now delete accidentally published plugins for up to 7 days!](https://discuss.gradle.org/t/plugin-authors-you-can-now-delete-accidentally-published-plugins-for-up-to-7-days/24013/2) for the last few days to do publish/delete to see where the issue was (sorry!).

---

<div class="post-metadata">

**Author:** ![mkobit](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/mkobit/32/7217_2.png) [@mkobit](https://discuss.gradle.org/u/mkobit)\
**Post date:** [September 12, 2017, 4:56pm UTC](https://discuss.gradle.org/t/com-gradle-plugin-publish-does-not-respect-new-java-library-configurations/24041/4 "2017-09-12T16:56:44Z")

</div>

For completeness, I filed [https://github.com/gradle/kotlin-dsl/issues/492](https://github.com/gradle/kotlin-dsl/issues/492) regarding the `build.gradle.kts` issue I mentioned at the the top of this response.

---

<div class="post-metadata">

**Author:** ![mkobit](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/mkobit/32/7217_2.png) [@mkobit](https://discuss.gradle.org/u/mkobit)\
**Post date:** [October 3, 2017, 10:24pm UTC](https://discuss.gradle.org/t/com-gradle-plugin-publish-does-not-respect-new-java-library-configurations/24041/5 "2017-10-03T22:24:58Z")

</div>

Looks like `0.9.8` was published last week.

I had to remove some of the previous dependencies from my Gradle cache due to bad POM from before, but it looks good so far.

Thanks @eljobe !
