build.gradle - How to share sub-projects with many other projects on Gradle? -
i new gradle, , running issues while trying share sub-projects among many other projects. project structure looks follows:
project | |--------------project b |--------------project c |--------------project d project e | |--------------project c |--------------project d where: project d | |---------------project c
project c
, project d
used in other projects frequently, act libraries data classes , database utilities.
project a
settings.gradle
file:
rootproject.name = 'projecta' include ":projectb" project(":projectb").projectdir = file("/home/myfolder/netbeansproject/projectb") include ":projectc" project(":projectc").projectdir = file("/home/myfolder/netbeansproject/projectc") include ":projectd" project(":projectd").projectdir = file("/home/myfolder/netbeansproject/projectd")
project a
build.gradle
file:
apply plugin: 'java' apply plugin: 'application' sourcecompatibility = '1.8' [compilejava, compiletestjava]*.options*.encoding = 'utf-8' if (!hasproperty('mainclass')) { ext.mainclass = '' } repositories { mavencentral() } dependencies { compile project (':projectb') compile project (':projectc') compile project (':projectd') }
likewise, other projects have similar settings , build files, containing respective sub-projects dependent on.
unfortunately, seem gradle gets confused when multiple projects dependent on same sub-projects.
for example, project e
runs fine, while project a
unable import classes of sub-projects.
error log:
exception 1: org.netbeans.gradle.model.util.transferableexceptionwrapper: org.gradle.api.internal.artifacts.ivyservice.defaultlenientconfiguration$artifactresolveexception: not resolve files configuration ':compileclasspath'. caused by: org.netbeans.gradle.model.util.transferableexceptionwrapper: org.gradle.internal.resolve.moduleversionresolveexception: not resolve project :projectc. caused by: org.netbeans.gradle.model.util.transferableexceptionwrapper: org.gradle.internal.component.nomatchingconfigurationselectionexception: unable find matching configuration of project :projectc: none of consumable configurations have attributes. @ org.gradle.internal.component.model.localcomponentdependencymetadata.selectconfigurations(localcomponentdependencymetadata.java:122) exception 2: org.netbeans.gradle.model.util.transferableexceptionwrapper: org.gradle.api.internal.artifacts.ivyservice.defaultlenientconfiguration$artifactresolveexception: not resolve files configuration ':runtimeclasspath'. caused by: org.netbeans.gradle.model.util.transferableexceptionwrapper: org.gradle.internal.resolve.moduleversionresolveexception: not resolve project :projectc. caused by: org.netbeans.gradle.model.util.transferableexceptionwrapper: org.gradle.internal.component.nomatchingconfigurationselectionexception: unable find matching configuration of project :projectc: none of consumable configurations have attributes. exception 3: org.netbeans.gradle.model.util.transferableexceptionwrapper: org.gradle.api.internal.artifacts.ivyservice.defaultlenientconfiguration$artifactresolveexception: not resolve files configuration ':testcompileclasspath'. caused by: org.netbeans.gradle.model.util.transferableexceptionwrapper: org.gradle.internal.resolve.moduleversionresolveexception: not resolve project :projectc. caused by: org.netbeans.gradle.model.util.transferableexceptionwrapper: org.gradle.internal.component.nomatchingconfigurationselectionexception: unable find matching configuration of project :projectc: none of consumable configurations have attributes. exception 4: org.netbeans.gradle.model.util.transferableexceptionwrapper: org.gradle.api.internal.artifacts.ivyservice.defaultlenientconfiguration$artifactresolveexception: not resolve files configuration ':testruntimeclasspath'. caused by: org.netbeans.gradle.model.util.transferableexceptionwrapper: org.gradle.internal.resolve.moduleversionresolveexception: not resolve project :projectc. caused by: org.netbeans.gradle.model.util.transferableexceptionwrapper: org.gradle.internal.component.nomatchingconfigurationselectionexception: unable find matching configuration of project :projectc: none of consumable configurations have attributes.
project c
, project d
both generate root project
folder points settings , build files project e
, not project a
.
why happening? shall in order project a
work sub-projects?
thank in advance taking time me gradle issues!
Comments
Post a Comment