Skip to content

Commit

Permalink
#314 Copy HSC only artifacts to staging repo
Browse files Browse the repository at this point in the history
Builds and integration tests copy many files to the mavenBuildRepo.
But JReleaser only wants to find the files for upload to Maven
Central. Therefore we copy those file to a `mavenStagingRepo`.

Somehow this seems to also have solved occasional flaws wrt
signing the artifacts which is necessary for Maven Central.
  • Loading branch information
ascheman committed Jan 27, 2025
1 parent 27081a7 commit f6687c4
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,33 +74,35 @@ ext.urls = [
developerConnection: 'scm:git:ssh://github.com/aim42/htmlSanityCheck.git'
]

// tag::mavenBuildRepo[]
File baseBuildDir = file("${project.rootDir}/${Project.DEFAULT_BUILD_DIR_NAME}")
File mavenBuildRepo = new File(baseBuildDir, "maven-repo")
// end::mavenBuildRepo[]

tasks.register("cleanMavenBuildRepo", Delete) {
description "Clean intermediate Maven Repository '${mavenBuildRepo}'"
description "Clean intermediate local Maven Repository '${mavenBuildRepo}'"
delete mavenBuildRepo
}

tasks.register('signAll') {
doLast {
logger.quiet("Signed all artifacts for upload with JReleaser")
}
File mavenStagingRepo = new File(baseBuildDir, "staging-repo")

tasks.register("cleanMavenStagingRepo", Delete) {
description "Clean intermediate staging Maven Repository '${mavenStagingRepo}'"
delete mavenBuildRepo
}

tasks.register("copyOrgAim42ToStagingRepo", Copy) {
description = "Copy 'org/aim42' from '${mavenBuildRepo}; to '${mavenStagingRepo}'"
from new File(mavenBuildRepo, "org/aim42")
into new File(mavenStagingRepo, "org/aim42")
}
signAll.dependsOn(
':htmlSanityCheck-core:signMavenJavaPublication',
':htmlSanityCheck-gradle-plugin:signHtmlSanityCheckPluginMarkerMavenPublication',
':htmlSanityCheck-gradle-plugin:signPluginMavenPublication'
)

jreleaserDeploy.dependsOn(
'signAll',
copyOrgAim42ToStagingRepo.dependsOn(
':htmlSanityCheck-core:publishAllPublicationsToMyLocalRepositoryForFullIntegrationTestsRepository',
':htmlSanityCheck-gradle-plugin:publishAllPublicationsToMyLocalRepositoryForFullIntegrationTestsRepository'
':htmlSanityCheck-gradle-plugin:publishAllPublicationsToMyLocalRepositoryForFullIntegrationTestsRepository',
':htmlSanityCheck-maven-plugin:publishAllPublicationsToMyLocalRepositoryForFullIntegrationTestsRepository'
)

jreleaserDeploy.dependsOn(copyOrgAim42ToStagingRepo)

jreleaser {
project {
license = 'Apache-2.0'
Expand Down

0 comments on commit f6687c4

Please sign in to comment.