Point ArtifactsTests to custom maven repo dir to avoid stale artifacts

^KTI-1345
This commit is contained in:
Bogdan Mukvich
2023-12-11 11:39:27 +01:00
committed by Space Team
parent d9f581c8b5
commit b7d56dea44
7 changed files with 28 additions and 16 deletions
+10
View File
@@ -991,6 +991,16 @@ tasks {
workingDir = rootProject.projectDir.resolve("libraries")
commandLine = getMvnwCmd() + listOf("clean", "install", "-DskipTests")
}
register<Exec>("mvnPublish") {
group = "publishing"
workingDir = rootProject.projectDir.resolve("libraries")
commandLine = getMvnwCmd() + listOf(
"clean", "deploy", "--activate-profiles=noTest",
"-Dinvoker.skip=true", "-DskipTests",
"-Ddeploy-snapshot-repo=local",
"-Ddeploy-snapshot-url=file://${rootProject.projectDir.resolve("build/repo")}"
)
}
}
val zipCompiler by tasks.registering(Zip::class) {
+4 -2
View File
@@ -60,6 +60,8 @@
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<deploy-snapshot-url>sonatype-nexus-staging</deploy-snapshot-url>
<deploy-snapshot-repo>https://oss.sonatype.org/content/repositories/snapshots/</deploy-snapshot-repo>
</properties>
<prerequisites>
@@ -72,8 +74,8 @@
<url>${deploy-url}</url>
</repository>
<snapshotRepository>
<id>sonatype-nexus-staging</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<id>${deploy-snapshot-repo}</id>
<url>${deploy-snapshot-url}</url>
</snapshotRepository>
</distributionManagement>
+4 -2
View File
@@ -50,6 +50,8 @@
neither it is visible in the consumer project.
-->
<kotlin.version>${project.version}</kotlin.version>
<deploy-snapshot-url>sonatype-nexus-staging</deploy-snapshot-url>
<deploy-snapshot-repo>https://oss.sonatype.org/content/repositories/snapshots/</deploy-snapshot-repo>
</properties>
<dependencyManagement>
@@ -186,8 +188,8 @@
<url>${deploy-url}</url>
</repository>
<snapshotRepository>
<id>sonatype-nexus-staging</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<id>${deploy-snapshot-repo}</id>
<url>${deploy-snapshot-url}</url>
</snapshotRepository>
</distributionManagement>
+1 -7
View File
@@ -5,11 +5,5 @@ This module contains tests for changes in pom files for all maven artifacts we p
To reproduce locally build all artifacts first:
```shell
# clean local m2 from old artifacts to avoid unrelated failures
# up-to-date version is in defaultSnapshotVersion property and should be used instead of "*-2.0.255*"
find ~/.m2/repository/org/jetbrains/kotlin -name "*-2.0.255*" -delete
./gradlew install
cd libraries
./mvnw install -DskipTests
./gradlew clean install publish mvnPublish
```
+1 -1
View File
@@ -18,7 +18,7 @@ projectTest(jUnitMode = JUnitMode.JUnit5) {
useJUnitPlatform { }
val kotlinVersion = version
doFirst {
val defaultMavenLocal = Paths.get(System.getProperty("user.home"), ".m2", "repository").toAbsolutePath()
val defaultMavenLocal = rootProject.projectDir.resolve("build/repo").absolutePath
val mavenLocal = System.getProperty("maven.repo.local") ?: defaultMavenLocal
systemProperty("maven.repo.local", mavenLocal)
systemProperty("kotlin.version", kotlinVersion)
@@ -50,6 +50,8 @@
neither it is visible in the consumer project.
-->
<kotlin.version>${project.version}</kotlin.version>
<deploy-snapshot-url>sonatype-nexus-staging</deploy-snapshot-url>
<deploy-snapshot-repo>https://oss.sonatype.org/content/repositories/snapshots/</deploy-snapshot-repo>
</properties>
<dependencyManagement>
@@ -186,8 +188,8 @@
<url>${deploy-url}</url>
</repository>
<snapshotRepository>
<id>sonatype-nexus-staging</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<id>${deploy-snapshot-repo}</id>
<url>${deploy-snapshot-url}</url>
</snapshotRepository>
</distributionManagement>
@@ -60,6 +60,8 @@
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<deploy-snapshot-url>sonatype-nexus-staging</deploy-snapshot-url>
<deploy-snapshot-repo>https://oss.sonatype.org/content/repositories/snapshots/</deploy-snapshot-repo>
</properties>
<prerequisites>
@@ -72,8 +74,8 @@
<url>${deploy-url}</url>
</repository>
<snapshotRepository>
<id>sonatype-nexus-staging</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<id>${deploy-snapshot-repo}</id>
<url>${deploy-snapshot-url}</url>
</snapshotRepository>
</distributionManagement>