custom-gradle-plugin Ursachen: Nicht konfiguriert 'publizieren' - Erweiterung

Habe ich eine custom-gradle-plugin, in der benutzerdefinierte task-Typen und gradle-Konfigurationen Hinzugefügt werden. Wenn ich dieses plugin vor maven-publish es funktioniert einwandfrei. Aber wenn ich es nach apply plugin: 'maven-publish' es scheitert mit der Fehlermeldung :

FAILURE: Build failed with an exception.

* Where:
Build file '/scratch/skgupta/git_storage/emdi/integtest/build.gradle' line: 38

* What went wrong:
A problem occurred evaluating root project 'integtest'.
> Cannot configure the 'publishing' extension after it has been accessed.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 7.6 secs

Hier ist die build.gradle Datei.

buildscript {
    repositories {
        maven {
            url = "${artifactory_contextUrl}/repo"
        }
    }

    dependencies {
        classpath group: 'com.mycomp.proj', name: 'MyCustomPlugin', version: "${pluginVersion}", transitive: true
    }   
}
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'MyCustomPlugin'  //WHen this line is moved above maven-publish, build works fine.

//add jar name and version
jar.archiveName='lrgemaas_small_deploy_3n.jar'
group = 'com.mycom.proj.test'
version = '1.0.3'

dependencies {
    compile group: 'eaas.platform', name: 'registry-lookup-client', version: '0.1'
    compile group: 'eaas.platform', name: 'registry-client', version: '0.1'
    compile configurations.lrgConfig  //This configuration is added by MyCustomPlugin
    compile configurations.webdriver  //This configuration is added by MyCustomPlugin
}

repositories {
    maven {
        url = "${artifactory_contextUrl}/repo"
    }
}

publishing {
    publications {
        myPublicationName(MavenPublication) {
            artifactId 'lrgemaas_small_deploy_3n'
            artifact jar.archivePath
        }
    }
    repositories {
        maven {
            url = "${artifactory_contextUrl}/${artifactory_repoName}"
            credentials {
                username = "${artifactory_user}"
                password = "${artifactory_password}"
            }
        }
    }
}

//workflow for build 
defaultTasks 'clean','build','publish'

PS: ich habe versucht zu tun, nichts in die eigene plugin (d.h., einfach wieder aus wenden-Methode), aber es gibt noch gleichen Fehler.

Schreibe einen Kommentar