I am upgrading from gradle 6.8.3 to gradle 7.
I am finding issues in translating the mavenLocalPublishing task in build.gradle with multiple artifacts.
The maven plugin and uploadArchives task are deprecated since quite some time and replaced by the maven-publish plugin.
Now finally they were removed: Gradle User Manual: Version 7.0
Use the maven-publish plugin instead.
Currently problem is - all published artefacts have same name a.jar, a-1.jar, a-2.jar and a-3.jar and all of them are existing in the same directly as a.jar but I would want the jar and pom to move to separate directories each for the jar. Could you please help me achieve that?
You replaced the maven plugin and uploadArchives task (which was of type Upload with a custom task of type Upload instead of using the maven-publish plugin as I recommended.
but i get - No signature of method: build_...publishing() is a..applicable for argument types: a(build_...$_run_closure30) values: [build_...$_run_closure30@..]
If you get such “No signature of method” errors, it means something is not correct within said closure.
Unfortunatley these messages are not too helpful in finding the actual error.
If I got those, I usually comment out all content of the closure and comment in line by line or block by block to find the place where I used wrong API.
Nowadays I use Kotlin DSL almost exclusively, as there you have much better IDE support, especially if you use IntelliJ IDEA, and you don’t have these non-helping error messages as they are only happening with Groovy DSL.