I am trying to do the same you have shown in this example. Yeah, want to use my sub modules just by a dependency key in build.gradle file. So I have created a parent project, and its build.gradle is same as yours...
apply plugin: 'java'
apply plugin: 'eclipse'
allprojects {
version = "1.0"
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
sourceCompatibility = 1.8 // java 8
targetCompatibility = 1.8
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
}
// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
rootProject.name = 'pype-commons'
include ':pdf-utils', ':file-utils', ':json-utils'
On console, while refreshing the gradle project, I am getting the following message...
CONFIGURE SUCCESSFUL in 0s
Could not resolve: com.github.m4monster.pype-commons:file-utils:v1.1.0
And while building the project, getting this...
Working Directory: C:\Workspace\pype-application
Gradle User Home: C:\Users\Khan\.gradle
Gradle Distribution: Gradle wrapper from target build
Gradle Version: 4.3
Java Home: C:\Program Files\Java\jdk1.8.0_162
JVM Arguments: None
Program Arguments: None
Build Scans Enabled: false
Offline Mode Enabled: false
Gradle Tasks: build
:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not find com.github.m4monster.pype-commons:file-utils:v1.1.0.
Searched in the following locations:
https://jcenter.bintray.com/com/github/m4monster/pype-commons/file-utils/v1.1.0/file-utils-v1.1.0.pom
https://jcenter.bintray.com/com/github/m4monster/pype-commons/file-utils/v1.1.0/file-utils-v1.1.0.jar
Required by:
project :
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
1 actionable task: 1 executed