[build] Pass/override JDK_1_8 env variable to maven exec tasks
While other JDKs can be used in the maven build, only JDK_1_8 is required for 'install' and 'deploy' goals without tests. Provide this path from the corresponding toolchain discovered by Gradle.
This commit is contained in:
committed by
Space Team
parent
6e763f5c41
commit
a15e88ba1e
@@ -47,6 +47,7 @@ plugins {
|
|||||||
if (kotlinBuildProperties.isKotlinNativeEnabled) {
|
if (kotlinBuildProperties.isKotlinNativeEnabled) {
|
||||||
id("kotlin.native.build-tools-conventions") apply false
|
id("kotlin.native.build-tools-conventions") apply false
|
||||||
}
|
}
|
||||||
|
`jvm-toolchains`
|
||||||
}
|
}
|
||||||
|
|
||||||
val isTeamcityBuild = project.kotlinBuildProperties.isTeamcityBuild
|
val isTeamcityBuild = project.kotlinBuildProperties.isTeamcityBuild
|
||||||
@@ -987,6 +988,9 @@ tasks {
|
|||||||
group = "publishing"
|
group = "publishing"
|
||||||
workingDir = rootProject.projectDir.resolve("libraries")
|
workingDir = rootProject.projectDir.resolve("libraries")
|
||||||
commandLine = getMvnwCmd() + listOf("clean", "install", "-DskipTests")
|
commandLine = getMvnwCmd() + listOf("clean", "install", "-DskipTests")
|
||||||
|
doFirst {
|
||||||
|
environment("JDK_1_8", getToolchainJdkHomeFor(JdkMajorVersion.JDK_1_8).get())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
register<Exec>("mvnPublish") {
|
register<Exec>("mvnPublish") {
|
||||||
group = "publishing"
|
group = "publishing"
|
||||||
@@ -997,6 +1001,9 @@ tasks {
|
|||||||
"-Ddeploy-snapshot-repo=local",
|
"-Ddeploy-snapshot-repo=local",
|
||||||
"-Ddeploy-snapshot-url=file://${rootProject.projectDir.resolve("build/repo")}"
|
"-Ddeploy-snapshot-url=file://${rootProject.projectDir.resolve("build/repo")}"
|
||||||
)
|
)
|
||||||
|
doFirst {
|
||||||
|
environment("JDK_1_8", getToolchainJdkHomeFor(JdkMajorVersion.JDK_1_8).get())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user