2015-11-06 10 views
5

मैं परियोजना संरचना नीचे है:प्लगइन माता पिता build.gradle में नहीं मिला

जावा/
    build.gradle
    settings.gradle
    PROJECTA/
        build.gradle
    प्रोजेक्ट बी/
        build.gradle

जब मैं, उदा कोड नीचे डाल projectA का build.gradle,

buildscript { 
    repositories { 
     mavenCentral() 
    } 
    dependencies { 
     classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.6.RELEASE") 
    } 
} 

apply plugin: 'java' 
apply plugin: 'eclipse' 
apply plugin: 'spring-boot' 
... 

सब कुछ ठीक काम करता है।

लेकिन अगर मैं जावा के build.gradle में उपरोक्त कोड डाल:

Plugin with id 'spring-boot' not found.

किसी को भी पहले इस समस्या का सामना करना पड़ा:

subprojects { 
    buildscript { 
     repositories { 
      mavenCentral() 
     } 
     dependencies { 
      classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.6.RELEASE") 
     } 
    } 

    apply plugin: 'java' 
    apply plugin: 'eclipse' 
    apply plugin: 'spring-boot' 
    ... 
} 

जब Gradle स्वच्छ निर्माण चल रहा है, यह त्रुटि नीचे रिपोर्टिंग रखता है? और क्यों?

उत्तर

7

मुझे एक समाधान पता चला लेकिन क्यों नहीं पता। कुछ समय के सप्ताहांत के दौरान डॉक्स पढ़ रहे हैं ...

बदलें बहु परियोजना build.gradle नीचे करने के लिए खर्च होगा:

buildscript { 
    repositories { 
     mavenCentral() 
    } 

    dependencies { 
      classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.6.RELEASE") 
    } 
} 

subprojects { 
    apply plugin: 'java' 
    apply plugin: 'eclipse' 
    apply plugin: 'spring-boot' 
    ... 
} 

यानी उप

से बाहर ले जाने के buildscript
संबंधित मुद्दे