i have two nexus repositories: one for releases, other for snapshots. i have code in publish task to define which repo to pick according to doc:
repositories {
repositories {
maven {
credentials {
username "$nexusUser"
password "$nexusPassword"
}
def releasesRepoUrl = "https://xxx/repository/factoring-maven-release/"
def snapshotsRepoUrl = "https://xxx/repository/factoring-maven-snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
publications {
create("default", MavenPublication.class) {
from(components["java"])
}
}
}
}
and subprojects included by this code :
rootProject.name = 'xxx-integration-lib'
include 'xxx-service1-dto'
include 'xxx-service2-dto'
subprojects build.gradle:
group = "xxx"
version = "0.0.6-SNAPSHOT"
but this doesnt work since subproject version is always unspecified. tried:
- making new allproject task to return version
- using project.property('propName') - but this seems like a workaround, not a solution
any thoughts?