2017-12-14 8 views
0

settings.gradle복합 프로젝트에서 빌드를 재귀 적으로 실행하려면 어떻게해야합니까?

rootProject.name = 'rpf' 
includeBuild('is') 
includeBuild('sec') { 
    dependencySubstitution { 
     substitute module("com.xenoterracide.rpf:is:0.1.0-SNAPSHOT") with project(":is") 
    } 
} 

build.gradle

plugins { 
    id 'com.brightsparklabs.gradle.multi-git' version '1.3.0' 
} 

group 'com.xenoterracide' 
version '0.1.0-SNAPSHOT' 

multiGitPluginConfig { 
    repositoriesDir = new File('.') 
    repositories = [ 
      'entity-api': '[email protected]:xenworks/entity-api.git', 
      'entity-jpa': '[email protected]:xenworks/entity-jpa.git', 
      'util': '[email protected]:xenworks/util.git', 
    ] 
} 

task build { 
    gradle.includedBuild('sec').task(':build') // sec is not currently a separate repo 
} 

여기

[email protected] MINGW64 ~/IdeaProjects/rpf (master) 
$ ./gradlew build --info 
Initialized native services in: C:\Users\xeno\.gradle\native 
The client will now receive all logging from the daemon (pid: 14968). The daemon log file: C:\Users\xeno\.gradle\daemon\4.4\daemon-14968.out.log 
Starting 297th build in daemon [uptime: 3 hrs 34 mins 24.533 secs, performance: 100%, no major garbage collections] 
Using 4 worker leases. 
Creating new cache for fileHashes, path C:\Users\xeno\IdeaProjects\rpf\.gradle\4.4\fileHashes\fileHashes.bin, access [email protected] 
Starting Build 
[composite-build] Configuring build: C:\Users\xeno\IdeaProjects\rpf\is 

> Configure project :is 
Evaluating project ':is' using build file 'C:\Users\xeno\IdeaProjects\rpf\is\build.gradle'. 
Creating new cache for metadata-1.1/results, path C:\Users\xeno\.gradle\caches\transforms-1\metadata-1.1\results.bin, access [email protected] 
Creating new cache for metadata-2.36/module-metadata, path C:\Users\xeno\.gradle\caches\modules-2\metadata-2.36\module-metadata.bin, access [email protected] 
Creating new cache for metadata-2.36/module-artifacts, path C:\Users\xeno\.gradle\caches\modules-2\metadata-2.36\module-artifacts.bin, access [email protected] 
Creating new cache for metadata-2.36/module-versions, path C:\Users\xeno\.gradle\caches\modules-2\metadata-2.36\module-versions.bin, access [email protected] 
Creating new cache for metadata-2.36/module-artifact, path C:\Users\xeno\.gradle\caches\modules-2\metadata-2.36\module-artifact.bin, access [email protected] 
Applying dependency management to configuration 'api' in project 'is' 
Applying dependency management to configuration 'apiElements' in project 'is' 
Applying dependency management to configuration 'archives' in project 'is' 
Applying dependency management to configuration 'compile' in project 'is' 
Applying dependency management to configuration 'compileClasspath' in project 'is' 
Applying dependency management to configuration 'compileOnly' in project 'is' 
Applying dependency management to configuration 'default' in project 'is' 
Applying dependency management to configuration 'implementation' in project 'is' 
Applying dependency management to configuration 'runtime' in project 'is' 
Applying dependency management to configuration 'runtimeClasspath' in project 'is' 
Applying dependency management to configuration 'runtimeElements' in project 'is' 
Applying dependency management to configuration 'runtimeOnly' in project 'is' 
Applying dependency management to configuration 'spotbugs' in project 'is' 
Applying dependency management to configuration 'spotbugsPlugins' in project 'is' 
Applying dependency management to configuration 'testCompile' in project 'is' 
Applying dependency management to configuration 'testCompileClasspath' in project 'is' 
Applying dependency management to configuration 'testCompileOnly' in project 'is' 
Applying dependency management to configuration 'testImplementation' in project 'is' 
Applying dependency management to configuration 'testRuntime' in project 'is' 
Applying dependency management to configuration 'testRuntimeClasspath' in project 'is' 
Applying dependency management to configuration 'testRuntimeOnly' in project 'is' 
Applying dependency management to configuration 'checkstyle' in project 'is' 

Registering project :is in composite build. Will substitute for module 'com.xenoterracide.rpf:is'. 
Settings evaluated using settings file 'C:\Users\xeno\IdeaProjects\rpf\settings.gradle'. 
Projects loaded. Root project using build file 'C:\Users\xeno\IdeaProjects\rpf\build.gradle'. 
Included projects: [root project 'rpf'] 

> Configure project : 
Evaluating root project 'rpf' using build file 'C:\Users\xeno\IdeaProjects\rpf\build.gradle'. 
Found no composite build substitute for module 'com.brightsparklabs.gradle.multi-git:com.brightsparklabs.gradle.multi-git.gradle.plugin'. 
Found no composite build substitute for module 'com.brightsparklabs.gradle.multi-git:com.brightsparklabs.gradle.multi-git.gradle.plugin'. 
Found no composite build substitute for module 'gradle.plugin.com.brightsparklabs:gradle-multi-git'. 

All projects evaluated. 
Selected primary task 'build' from project : 
Tasks to be executed: [task ':build'] 
Creating new cache for resourceHashesCache, path C:\Users\xeno\IdeaProjects\rpf\.gradle\4.4\fileHashes\resourceHashesCache.bin, access [email protected] 
Invalidating in-memory cache of C:\Users\xeno\IdeaProjects\rpf\.gradle\4.4\fileHashes\resourceHashesCache.bin 
Creating new cache for taskHistory, path C:\Users\xeno\IdeaProjects\rpf\.gradle\4.4\taskHistory\taskHistory.bin, access [email protected] 
Creating new cache for outputFiles, path C:\Users\xeno\IdeaProjects\rpf\.gradle\buildOutputCleanup\outputFiles.bin, access [email protected] 
:build (Thread[Daemon worker Thread 25,5,main]) started. 

> Task :build UP-TO-DATE 
Skipping task ':build' as it has no actions. 

:build (Thread[Daemon worker Thread 25,5,main]) completed. Took 0.0 secs. 

BUILD SUCCESSFUL in 0s 

나는 내가 부분적으로 작업을 찍었을 것 같아요 출력의 내,하지만 여전히 초

구축되지

나는 bu를 바꿨다. ILD 작업이

task build { 
    dependsOn gradle.includedBuild('is').task(':build') 
    dependsOn gradle.includedBuild('sec').task(':build') 
} 

처럼 여기 출력의 위해 문제가 명백한 것, 어떤 이유로 그것은 :sec:is뿐 아니라 :is해야한다 생각하지만 난 그

해결 방법을 생각하지 않은 여기
[email protected] MINGW64 ~/IdeaProjects/rpf (master) 
$ ./gradlew build --info 
Initialized native services in: C:\Users\xeno\.gradle\native 
The client will now receive all logging from the daemon (pid: 14968). The daemon log file: C:\Users\xeno\.gradle\daemon\4.4\daemon-14968.out.log 
Starting 364th build in daemon [uptime: 4 hrs 4 mins 32.226 secs, performance: 99%, no major garbage collections] 
Using 4 worker leases. 
Creating new cache for fileHashes, path C:\Users\xeno\IdeaProjects\rpf\.gradle\4.4\fileHashes\fileHashes.bin, access [email protected] 
Starting Build 
[composite-build] Configuring build: C:\Users\xeno\IdeaProjects\rpf\is 

> Configure project :is 
Evaluating project ':is' using build file 'C:\Users\xeno\IdeaProjects\rpf\is\build.gradle'. 
Creating new cache for metadata-1.1/results, path C:\Users\xeno\.gradle\caches\transforms-1\metadata-1.1\results.bin, access [email protected] 
Creating new cache for metadata-2.36/module-metadata, path C:\Users\xeno\.gradle\caches\modules-2\metadata-2.36\module-metadata.bin, access [email protected] 
Creating new cache for metadata-2.36/module-artifacts, path C:\Users\xeno\.gradle\caches\modules-2\metadata-2.36\module-artifacts.bin, access [email protected] 
Creating new cache for metadata-2.36/module-versions, path C:\Users\xeno\.gradle\caches\modules-2\metadata-2.36\module-versions.bin, access [email protected] 
Creating new cache for metadata-2.36/module-artifact, path C:\Users\xeno\.gradle\caches\modules-2\metadata-2.36\module-artifact.bin, access [email protected] 
Applying dependency management to configuration 'api' in project 'is' 
Applying dependency management to configuration 'apiElements' in project 'is' 
Applying dependency management to configuration 'archives' in project 'is' 
Applying dependency management to configuration 'compile' in project 'is' 
Applying dependency management to configuration 'compileClasspath' in project 'is' 
Applying dependency management to configuration 'compileOnly' in project 'is' 
Applying dependency management to configuration 'default' in project 'is' 
Applying dependency management to configuration 'implementation' in project 'is' 
Applying dependency management to configuration 'runtime' in project 'is' 
Applying dependency management to configuration 'runtimeClasspath' in project 'is' 
Applying dependency management to configuration 'runtimeElements' in project 'is' 
Applying dependency management to configuration 'runtimeOnly' in project 'is' 
Applying dependency management to configuration 'spotbugs' in project 'is' 
Applying dependency management to configuration 'spotbugsPlugins' in project 'is' 
Applying dependency management to configuration 'testCompile' in project 'is' 
Applying dependency management to configuration 'testCompileClasspath' in project 'is' 
Applying dependency management to configuration 'testCompileOnly' in project 'is' 
Applying dependency management to configuration 'testImplementation' in project 'is' 
Applying dependency management to configuration 'testRuntime' in project 'is' 
Applying dependency management to configuration 'testRuntimeClasspath' in project 'is' 
Applying dependency management to configuration 'testRuntimeOnly' in project 'is' 
Applying dependency management to configuration 'checkstyle' in project 'is' 

Registering project :is in composite build. Will substitute for module 'com.xenoterracide.rpf:is'. 
Settings evaluated using settings file 'C:\Users\xeno\IdeaProjects\rpf\settings.gradle'. 
Projects loaded. Root project using build file 'C:\Users\xeno\IdeaProjects\rpf\build.gradle'. 
Included projects: [root project 'rpf'] 

> Configure project : 
Evaluating root project 'rpf' using build file 'C:\Users\xeno\IdeaProjects\rpf\build.gradle'. 
Found no composite build substitute for module 'com.brightsparklabs.gradle.multi-git:com.brightsparklabs.gradle.multi-git.gradle.plugin'. 
Found no composite build substitute for module 'com.brightsparklabs.gradle.multi-git:com.brightsparklabs.gradle.multi-git.gradle.plugin'. 
Found no composite build substitute for module 'gradle.plugin.com.brightsparklabs:gradle-multi-git'. 

All projects evaluated. 
Selected primary task 'build' from project : 

> Configure project :sec 
Evaluating project ':sec' using build file 'C:\Users\xeno\IdeaProjects\rpf\sec\build.gradle'. 
Found no composite build substitute for module 'com.github.spotbugs:com.github.spotbugs.gradle.plugin'. 
Found no composite build substitute for module 'io.spring.gradle:dependency-management-plugin'. 
Found no composite build substitute for module 'com.github.spotbugs:com.github.spotbugs.gradle.plugin'. 
Found no composite build substitute for module 'gradle.plugin.com.github.spotbugs:gradlePlugin'. 
Found no composite build substitute for module 'com.github.spotbugs:spotbugs'. 
Found no composite build substitute for module 'org.ow2.asm:asm'. 
Found no composite build substitute for module 'org.ow2.asm:asm-analysis'. 
Found no composite build substitute for module 'org.ow2.asm:asm-commons'. 
Found no composite build substitute for module 'org.ow2.asm:asm-tree'. 
Found no composite build substitute for module 'org.ow2.asm:asm-util'. 
Found no composite build substitute for module 'org.ow2.asm:asm-xml'. 
Found no composite build substitute for module 'org.apache.bcel:bcel'. 
Found no composite build substitute for module 'net.jcip:jcip-annotations'. 
Found no composite build substitute for module 'dom4j:dom4j'. 
Found no composite build substitute for module 'jaxen:jaxen'. 
Found no composite build substitute for module 'commons-lang:commons-lang'. 
Found no composite build substitute for module 'com.google.code.findbugs:jFormatString'. 
Found no composite build substitute for module 'com.github.spotbugs:spotbugs-annotations'. 
Found no composite build substitute for module 'xml-apis:xml-apis'. 
Found no composite build substitute for module 'com.google.code.findbugs:jsr305'. 
Applying dependency management to configuration 'api' in project 'sec' 
Applying dependency management to configuration 'apiElements' in project 'sec' 
Applying dependency management to configuration 'archives' in project 'sec' 
Applying dependency management to configuration 'compile' in project 'sec' 
Applying dependency management to configuration 'compileClasspath' in project 'sec' 
Applying dependency management to configuration 'compileOnly' in project 'sec' 
Applying dependency management to configuration 'default' in project 'sec' 
Applying dependency management to configuration 'implementation' in project 'sec' 
Applying dependency management to configuration 'runtime' in project 'sec' 
Applying dependency management to configuration 'runtimeClasspath' in project 'sec' 
Applying dependency management to configuration 'runtimeElements' in project 'sec' 
Applying dependency management to configuration 'runtimeOnly' in project 'sec' 
Applying dependency management to configuration 'spotbugs' in project 'sec' 
Applying dependency management to configuration 'spotbugsPlugins' in project 'sec' 
Applying dependency management to configuration 'testCompile' in project 'sec' 
Applying dependency management to configuration 'testCompileClasspath' in project 'sec' 
Applying dependency management to configuration 'testCompileOnly' in project 'sec' 
Applying dependency management to configuration 'testImplementation' in project 'sec' 
Applying dependency management to configuration 'testRuntime' in project 'sec' 
Applying dependency management to configuration 'testRuntimeClasspath' in project 'sec' 
Applying dependency management to configuration 'testRuntimeOnly' in project 'sec' 
Applying dependency management to configuration 'checkstyle' in project 'sec' 

Selected primary task ':build' from project : 
Creating new cache for annotation-processors, path C:\Users\xeno\IdeaProjects\rpf\sec\.gradle\4.4\fileContent\annotation-processors.bin, access [email protected] 
Resolving global dependency management for project 'sec' 
Found no composite build substitute for module 'com.xenoterracide:bom'. 
Found no composite build substitute for module 'io.spring.platform:platform-bom'. 
Found no composite build substitute for module 'org.springframework.boot:spring-boot-starter-parent'. 
Found no composite build substitute for module 'org.springframework.boot:spring-boot-dependencies'. 
Found no composite build substitute for module 'com.fasterxml.jackson:jackson-bom'. 
Found no composite build substitute for module 'com.fasterxml.jackson:jackson-parent'. 
Found no composite build substitute for module 'com.fasterxml:oss-parent'. 
Found no composite build substitute for module 'org.apache.logging.log4j:log4j-bom'. 
Found no composite build substitute for module 'org.apache:apache'. 
Found no composite build substitute for module 'org.springframework:spring-framework-bom'. 
Found no composite build substitute for module 'org.springframework.data:spring-data-releasetrain'. 
Found no composite build substitute for module 'org.springframework.data.build:spring-data-build'. 
Found no composite build substitute for module 'org.springframework.integration:spring-integration-bom'. 
Found no composite build substitute for module 'org.springframework.security:spring-security-bom'. 
Found no composite build substitute for module 'org.springframework:spring-web'. 
Found no composite build substitute for module 'org.springframework.boot:spring-boot-starter-data-rest'. 
Found no composite build substitute for module 'org.eclipse.persistence:javax.persistence'. 
Found no composite build substitute for module 'javax.validation:validation-api'. 
Found no composite build substitute for module 'org.hibernate:hibernate-validator'. 
Found no composite build substitute for module 'org.springframework:spring-core'. 
Found no composite build substitute for module 'org.springframework:spring-context'. 
Found no composite build substitute for module 'org.springframework.boot:spring-boot-starter-security'. 
Found no composite build substitute for module 'org.springframework.data:spring-data-commons'. 
Found no composite build substitute for module 'org.springframework.data:spring-data-jpa'. 
Found no composite build substitute for module 'org.springframework.security:spring-security-acl'. 
Found no composite build substitute for module 'org.springframework:spring-tx'. 
Found no composite build substitute for module 'com.xenoterracide:entity-api'. 
Found no composite build substitute for module 'com.xenoterracide:entity-jpa'. 
Found project 'project :is' as substitute for module 'com.xenoterracide.rpf:is'. 

FAILURE: Build failed with an exception. 

* What went wrong: 
Could not determine the dependencies of task ':sec:compileJava'. 
> Could not resolve all dependencies for configuration ':sec:detachedConfiguration15'. 
    > project :sec:is was not found. 

내가

dependencies { 
    compileOnly 'org.springframework:spring-web' 
    compileOnly 'org.springframework.boot:spring-boot-starter-data-rest' 
    compileOnly 'org.eclipse.persistence:javax.persistence' 
    implementation 'javax.validation:validation-api' 
    implementation 'org.hibernate:hibernate-validator' 
    implementation 'org.springframework:spring-core' 
    implementation 'org.springframework:spring-context' 
    implementation 'org.springframework.boot:spring-boot-starter-security' 
    implementation 'org.springframework.data:spring-data-commons' 
    implementation 'org.springframework.data:spring-data-jpa' 
    implementation 'org.springframework.security:spring-security-acl' 
    implementation 'org.springframework:spring-tx' 
    implementation 'com.xenoterracide:entity-api:0.1.0-SNAPSHOT' 
    implementation 'com.xenoterracide:entity-jpa:0.1.0-SNAPSHOT' 
    implementation 'com.xenoterracide.rpf:is:0.1.0-SNAPSHOT' 
    testRuntimeOnly 'com.h2database:h2' 
    testRuntimeOnly 'org.apache.tomcat.embed:tomcat-embed-el' 
    testImplementation 'org.springframework.boot:spring-boot-starter-test' 
    testImplementation 'org.springframework.boot:spring-boot-starter-data-jpa' 
    testImplementation 'org.apache.commons:commons-lang3' 
    testImplementation 'nl.jqno.equalsverifier:equalsverifier' 
} 

프로젝트 의존성의이 어떻게 빌드 작업 successf를 실행하는 Gradle을 얻는 것을 정의하는 방법은 ully는 복합체 빌드를 위해? 제대로 컴파일 해결되고 :

includeBuild('sec') 

은 클래스와 함께 잘 작동

includeBuild('sec') { 
    dependencySubstitution { 
     substitute module("com.xenoterracide.rpf:is:0.1.0-SNAPSHOT") with project(":is") 
    } 
} 

최소한의 예를 실행 :

+0

@tkruse 매우 자연 스럽기 때문에이 "최소"를 사용하는 것이 간단하지 않으므로 ... 최소한의 https://bitbucket.org/account/user/xenworks/projects/GCPD에 대한 소스 코드는 – xenoterracide

+0

입니다. 내가 묻는 것은 3 개의 최소 build.gradle 파일과 settings.gradle 파일을 bitbucket에서 여기까지 복사하는 것입니다. – tkruse

답변

0

나는 당신이이 경우에 dependencySubstitution를 선언 할 필요가 없습니다 생각 :비서.

+0

왜 필요하지 않습니까? 문서에서는 모듈을 로컬 빌드로 대체하기 만하면됩니다. 나는 그 테스트가 작동하는지 확인하기 위해 추가하고있는'build.dependsOn ... task'와 관련이 있다고 생각합니다. 만약 그 테스트를 제거하면 녹색이지만 테스트가 없습니다. (그리고 실제로 실제로 빌드 중임을 확신하지는 못합니다.) – xenoterracide