0

I'm working on a Gradle project (with plugin maven-publish) that has a lot of convoluted logic for custom MavenPublications. I would like to look under the hood of the task publish. In particular, I would like to check the metadata of any/all MavenPublications, without actually running the task publish.

I know how to do some of the debug printing for regular tasks, but as far as I know, maven-publish plugin generates the tasks on the fly for every artifact+repository pair. Maybe there is a simple way to iterate over all MavenPublications? In an afterEvaluate block, for example.

Perhaps I could get enough information from running publishToMavenLocal and checking ~/.m2, but it is very time consuming to iterate using publishToMavenLocal due to project size – it would be much faster to debug print the information about MavenPublications.

andrybak
  • 2,129
  • 2
  • 20
  • 40

1 Answers1

0

It is possible to debug tasks in some IDEs, for example in IntelliJ: https://www.jetbrains.com/help/idea/work-with-gradle-tasks.html#debug_gradle

Gradle also provides documentation on this:

https://docs.gradle.org/current/userguide/troubleshooting.html#sec:troubleshooting_build_logic

In fact, the Gradle docs above debug exactly what you are trying to do.

Cisco
  • 20,972
  • 5
  • 38
  • 60