Error occurs during publish task

thumbnail
Enrico Oliosi, modified 6 Years ago. Junior Member Posts: 73 Join Date: 7/6/10 Recent Posts
Hi everybody. I am using these environment:

Blade version => 3.4.4.SNAPSHOT201901232230
Gradle version => Gradle 4.10.2 
Workspace plugin => classpath group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "1.10.16"

I'd like to define publish step, but when I invoke "publish" task I get this stacktrace:

[...]
org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [class 'io.spring.gradle.dependencymanagement.DependencyManagementPlugin']
[...]
Cannot configure the 'publishing' extension after it has been accessed.

This is the configuration written into build.gradle:
[...]
configure(subprojects.findAll { it.parent.name.contains('modules') } ) {

    apply plugin: 'maven-publish'

    publishing {
        publications {
            mavenJava(MavenPublication) {
                   [...]
             }
         }
        
         repositories {
            maven {
                [...]
            }
        }
    }        
}

It seems there is a conflict between DependencyManagementPlugin applied by both workspace plug-in and publish plugin. Any idea?

Thanks.

Enrico