hibernate-orm/gradle/published-java-module.gradle

134 lines
3.2 KiB
Groovy
Raw Normal View History

/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
apply from: rootProject.file( 'gradle/releasable.gradle' )
apply from: rootProject.file( 'gradle/java-module.gradle' )
apply from: rootProject.file( 'gradle/publishing-pom.gradle' )
apply plugin: 'signing'
tasks.getByPath( ':release:publishReleaseArtifacts' ).dependsOn tasks.release
configurations {
javadocSources {
description 'Used to aggregate javadocs for the whole project'
}
}
dependencies {
javadocSources sourceSets.main.allJava
}
2022-02-07 09:02:13 -05:00
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Publishing
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
2022-02-07 09:02:13 -05:00
// main publication
2018-02-01 15:00:37 -05:00
publishedArtifacts {
from components.java
}
2019-05-21 17:29:57 -04:00
2022-02-07 09:02:13 -05:00
// relocation for the published artifacts based on the old groupId
2021-10-13 04:24:56 -04:00
relocationPom( MavenPublication ) {
2019-05-21 17:29:57 -04:00
pom {
name = project.name + ' - relocation'
groupId = 'org.hibernate'
artifactId = project.name
version = project.version
description = project.description
url = 'https://hibernate.org/orm'
2019-05-21 17:29:57 -04:00
organization {
name = 'Hibernate.org'
url = 'https://hibernate.org'
2019-05-21 17:29:57 -04:00
}
licenses {
license {
name = 'GNU Library General Public License v2.1 or later'
url = 'https://www.opensource.org/licenses/LGPL-2.1'
comments = 'See discussion at https://hibernate.org/community/license/ for more details.'
2019-05-21 17:29:57 -04:00
distribution = 'repo'
}
}
scm {
url = 'https://github.com/hibernate/hibernate-orm'
connection = 'scm:git:https://github.com/hibernate/hibernate-orm.git'
2019-05-21 17:29:57 -04:00
developerConnection = 'scm:git:git@github.com:hibernate/hibernate-orm.git'
}
developers {
developer {
id = 'hibernate-team'
name = 'The Hibernate Development Team'
organization = 'Hibernate.org'
organizationUrl = 'https://hibernate.org'
2019-05-21 17:29:57 -04:00
}
}
issueManagement {
system = 'jira'
url = 'https://hibernate.atlassian.net/browse/HHH'
}
distributionManagement {
relocation {
groupId = 'org.hibernate.orm'
artifactId = project.name
version = project.version
}
}
}
}
}
}
2022-02-07 09:02:13 -05:00
signing {
required { !rootProject.ormVersion.isSnapshot && gradle.taskGraph.hasTask("publish") }
2022-02-07 09:02:13 -05:00
def signingKey = findProperty('signingKey')
def signingPassword = findProperty('signingPassword')
2022-02-07 09:02:13 -05:00
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.publishedArtifacts
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Release / publishing tasks
task ciBuild {
dependsOn test, publish
}
2018-02-01 14:19:08 -05:00
tasks.release.dependsOn tasks.test, tasks.publishToSonatype
tasks.publishToSonatype.mustRunAfter test
2018-02-01 14:19:08 -05:00
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Ancillary tasks
task showPublications {
doFirst {
project.publishing.publications.each { publication ->
println "Publication (${publication.name}): ${publication.groupId}:${publication.artifactId}:${publication.version}"
publication.artifacts.each { artifact ->
println " > ${artifact}"
}
}
}
}