HHH-18912 - ORM release process
https://hibernate.atlassian.net/browse/HHH-18912
This commit is contained in:
parent
e006427920
commit
5d799730a1
|
@ -75,7 +75,10 @@ configurations {
|
|||
}
|
||||
|
||||
javadocSources {
|
||||
description = 'Source files to be built by the javadoc tool'
|
||||
description = 'All Java sources for the aggregated Javadocs'
|
||||
canBeConsumed = false
|
||||
canBeResolved = true
|
||||
visible = false
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -145,6 +148,7 @@ dependencies {
|
|||
testing project( ':hibernate-testing' )
|
||||
|
||||
spatial project( ':hibernate-spatial' )
|
||||
javadocSources project( path: ':hibernate-spatial', configuration: 'javadocSources' )
|
||||
|
||||
agroal project( ':hibernate-agroal' )
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* Copyright Red Hat Inc. and Hibernate Authors
|
||||
*/
|
||||
var publishingExtension = project.getExtensions().getByType(PublishingExtension) as PublishingExtension
|
||||
publishingExtension.publications.create("groupRelocation", MavenPublication) {
|
||||
pom {
|
||||
name = project.name + ' (relocated)'
|
||||
groupId = 'org.hibernate'
|
||||
|
||||
distributionManagement {
|
||||
relocation {
|
||||
groupId = project.group
|
||||
artifactId = project.name
|
||||
version = project.version
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -18,7 +18,7 @@ buildscript {
|
|||
}
|
||||
}
|
||||
|
||||
import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis
|
||||
|
||||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
|
||||
apply plugin: 'java-library'
|
||||
|
@ -159,21 +159,6 @@ dependencies {
|
|||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
javadocSources {
|
||||
canBeConsumed = true
|
||||
canBeResolved = false
|
||||
visible = false
|
||||
description = 'Configuration for accessing the sources that should be included in the javadoc for the project'
|
||||
}
|
||||
}
|
||||
|
||||
artifacts {
|
||||
sourceSets.main.allJava.srcDirs.each { srcDir ->
|
||||
javadocSources srcDir
|
||||
}
|
||||
}
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Compilation
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ tasks.named( "javadoc", Javadoc ) {
|
|||
}
|
||||
}
|
||||
|
||||
task javadocJar(type: Jar) {
|
||||
tasks.register("javadocJar", Jar) {
|
||||
from project.tasks.javadoc.outputs
|
||||
manifest {
|
||||
attributes(
|
||||
|
|
|
@ -5,18 +5,20 @@
|
|||
* 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 from: rootProject.file( 'gradle/publishing.gradle' )
|
||||
|
||||
apply plugin: 'signing'
|
||||
|
||||
// Make sure that the publishReleaseArtifacts task of the release module runs the release task of this sub module
|
||||
tasks.getByPath( ':release:publishReleaseArtifacts' ).dependsOn tasks.release
|
||||
tasks.register("publishReleaseArtifacts") {
|
||||
// mirror for `:release:publishReleaseArtifacts`
|
||||
dependsOn tasks.release
|
||||
}
|
||||
|
||||
configurations {
|
||||
javadocSources {
|
||||
description 'Used to aggregate javadocs for the whole project'
|
||||
description = "All Java sources for the project's Javadoc"
|
||||
canBeConsumed = true
|
||||
canBeResolved = false
|
||||
visible = false
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,66 +38,12 @@ java {
|
|||
// Publishing
|
||||
|
||||
var publishingExtension = project.getExtensions().getByType(PublishingExtension) as PublishingExtension
|
||||
publishingExtension.publications {
|
||||
// main publication
|
||||
publishedArtifacts {
|
||||
// Add the Java component to the main publication
|
||||
from components.java
|
||||
}
|
||||
publishingExtension.publications.named("publishedArtifacts", MavenPublication) {
|
||||
// Add the Java component to the main publication
|
||||
from components.java
|
||||
}
|
||||
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Signing
|
||||
|
||||
def signingKey = resolveSigningKey()
|
||||
def signingPassphrase = resolveSigningPassphrase()
|
||||
|
||||
var signingExtension = project.getExtensions().getByType(SigningExtension) as SigningExtension
|
||||
signingExtension.sign publishingExtension.publications.publishedArtifacts
|
||||
signingExtension.useInMemoryPgpKeys(signingKey, signingPassphrase)
|
||||
|
||||
gradle.taskGraph.whenReady { TaskExecutionGraph graph ->
|
||||
boolean wasPublishingRequested = false
|
||||
|
||||
graph.allTasks.each {task ->
|
||||
if ( task instanceof PublishToMavenRepository ) {
|
||||
wasPublishingRequested = true
|
||||
}
|
||||
}
|
||||
|
||||
if ( wasPublishingRequested ) {
|
||||
def ossrhUser = System.getenv().get( "ORG_GRADLE_PROJECT_sonatypeUsername" )
|
||||
def ossrhPass = System.getenv().get( "ORG_GRADLE_PROJECT_sonatypePassword" )
|
||||
if ( ossrhUser == null || ossrhPass == null ) {
|
||||
throw new RuntimeException( "Cannot perform publishing to OSSRH without credentials." )
|
||||
}
|
||||
logger.lifecycle "Publishing {} : {} : {}", project.group, project.name, project.version
|
||||
signingExtension.required = true
|
||||
}
|
||||
else if ( signingKey == null || signingPassphrase == null ) {
|
||||
tasks.withType( Sign ).each { t-> t.enabled = false }
|
||||
}
|
||||
}
|
||||
|
||||
static String resolveSigningKey() {
|
||||
var key = System.getenv().get( "SIGNING_GPG_PRIVATE_KEY" )
|
||||
if ( key != null ) {
|
||||
return key
|
||||
}
|
||||
|
||||
var keyFile = System.getenv().get( "SIGNING_GPG_PRIVATE_KEY_PATH" )
|
||||
if ( keyFile != null ) {
|
||||
return new File( keyFile ).text
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
static String resolveSigningPassphrase() {
|
||||
return System.getenv().get( "SIGNING_GPG_PASSPHRASE" )
|
||||
}
|
||||
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Release / publishing tasks
|
||||
|
@ -112,17 +60,3 @@ tasks.preVerifyRelease.dependsOn generatePomFileForPublishedArtifactsPublication
|
|||
|
||||
tasks.publishToSonatype.mustRunAfter test
|
||||
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Ancillary tasks
|
||||
|
||||
tasks.register('showPublications') {
|
||||
doFirst {
|
||||
project.publishing.publications.each { publication ->
|
||||
println "Publication (${publication.name}): ${publication.groupId}:${publication.artifactId}:${publication.version}"
|
||||
publication.artifacts.each { artifact ->
|
||||
println " > ${artifact}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
/*
|
||||
* 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 plugin: 'maven-publish'
|
||||
|
||||
// Disable Gradle module metadata publishing until we know what we want.
|
||||
// https://docs.gradle.org/6.0.1/userguide/publishing_gradle_module_metadata.html#sub:disabling-gmm-publication
|
||||
tasks.withType(GenerateModuleMetadata) {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
publishedArtifacts( MavenPublication ) {
|
||||
pom {
|
||||
name = 'Hibernate ORM - ' + project.name
|
||||
description = project.description
|
||||
url = 'https://hibernate.org/orm'
|
||||
|
||||
organization {
|
||||
name = 'Hibernate.org'
|
||||
url = 'https://hibernate.org'
|
||||
}
|
||||
|
||||
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.'
|
||||
distribution = 'repo'
|
||||
}
|
||||
}
|
||||
|
||||
scm {
|
||||
url = 'https://github.com/hibernate/hibernate-orm'
|
||||
connection = 'scm:git:https://github.com/hibernate/hibernate-orm.git'
|
||||
developerConnection = 'scm:git:git@github.com:hibernate/hibernate-orm.git'
|
||||
}
|
||||
|
||||
issueManagement {
|
||||
system = 'jira'
|
||||
url = 'https://hibernate.atlassian.net/browse/HHH'
|
||||
}
|
||||
|
||||
developers {
|
||||
developer {
|
||||
id = 'hibernate-team'
|
||||
name = 'The Hibernate Development Team'
|
||||
organization = 'Hibernate.org'
|
||||
organizationUrl = 'https://hibernate.org'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,173 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* Copyright Red Hat Inc. and Hibernate Authors
|
||||
*/
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'signing'
|
||||
|
||||
apply from: rootProject.file( 'gradle/releasable.gradle' )
|
||||
|
||||
// Disable Gradle module metadata publishing until we know what we want.
|
||||
// https://docs.gradle.org/6.0.1/userguide/publishing_gradle_module_metadata.html#sub:disabling-gmm-publication
|
||||
tasks.withType(GenerateModuleMetadata).configureEach {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
var publishingExtension = project.getExtensions().getByType(PublishingExtension) as PublishingExtension
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Apply standard POM information for all publications
|
||||
|
||||
publishingExtension.publications.configureEach {
|
||||
pom {
|
||||
url = 'https://hibernate.org/orm'
|
||||
|
||||
organization {
|
||||
name = 'Hibernate.org'
|
||||
url = 'https://hibernate.org'
|
||||
}
|
||||
|
||||
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.'
|
||||
distribution = 'repo'
|
||||
}
|
||||
}
|
||||
|
||||
scm {
|
||||
url = 'https://github.com/hibernate/hibernate-orm'
|
||||
connection = 'scm:git:https://github.com/hibernate/hibernate-orm.git'
|
||||
developerConnection = 'scm:git:git@github.com:hibernate/hibernate-orm.git'
|
||||
}
|
||||
|
||||
issueManagement {
|
||||
system = 'jira'
|
||||
url = 'https://hibernate.atlassian.net/browse/HHH'
|
||||
}
|
||||
|
||||
developers {
|
||||
developer {
|
||||
id = 'hibernate-team'
|
||||
name = 'The Hibernate Development Team'
|
||||
organization = 'Hibernate.org'
|
||||
organizationUrl = 'https://hibernate.org'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// register the "main" publication named `publishedArtifacts`
|
||||
|
||||
publishingExtension.publications.create("publishedArtifacts", MavenPublication) {
|
||||
pom {
|
||||
name = 'Hibernate ORM - ' + project.name
|
||||
description = project.description
|
||||
}
|
||||
}
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Create a special local repository used for local testing of PublishToMavenRepository
|
||||
|
||||
if ( project.hasProperty("local_pub_repo") ) {
|
||||
// used for
|
||||
publishingExtension.repositories {
|
||||
maven {
|
||||
name = "localRepo"
|
||||
url = rootProject.layout.buildDirectory.dir("maven-repo").get().asFile.toURI()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Signing
|
||||
|
||||
def signingKey = resolveSigningKey()
|
||||
def signingPassphrase = resolveSigningPassphrase()
|
||||
|
||||
var signingExtension = project.getExtensions().getByType(SigningExtension) as SigningExtension
|
||||
signingExtension.sign publishingExtension.publications.publishedArtifacts
|
||||
signingExtension.useInMemoryPgpKeys(signingKey, signingPassphrase)
|
||||
|
||||
gradle.taskGraph.whenReady { TaskExecutionGraph graph ->
|
||||
// are we publishing to OSSRH?
|
||||
boolean wasPublishingRequested = false
|
||||
|
||||
graph.allTasks.each {task ->
|
||||
if ( task instanceof PublishToMavenRepository ) {
|
||||
if ( "sonatype" == task.repository.name ) {
|
||||
wasPublishingRequested = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( wasPublishingRequested ) {
|
||||
def ossrhUser = System.getenv().get( "ORG_GRADLE_PROJECT_sonatypeUsername" )
|
||||
def ossrhPass = System.getenv().get( "ORG_GRADLE_PROJECT_sonatypePassword" )
|
||||
if ( ossrhUser == null || ossrhPass == null ) {
|
||||
throw new RuntimeException( "Cannot perform publishing to OSSRH without credentials." )
|
||||
}
|
||||
logger.lifecycle "Publishing {} : {} : {}", project.group, project.name, project.version
|
||||
signingExtension.required = true
|
||||
}
|
||||
else if ( signingKey == null || signingPassphrase == null ) {
|
||||
tasks.withType( Sign ).each { t-> t.enabled = false }
|
||||
}
|
||||
}
|
||||
|
||||
static String resolveSigningKey() {
|
||||
var key = System.getenv().get( "SIGNING_GPG_PRIVATE_KEY" )
|
||||
if ( key != null ) {
|
||||
return key
|
||||
}
|
||||
|
||||
var keyFile = System.getenv().get( "SIGNING_GPG_PRIVATE_KEY_PATH" )
|
||||
if ( keyFile != null ) {
|
||||
return new File( keyFile ).text
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
static String resolveSigningPassphrase() {
|
||||
return System.getenv().get( "SIGNING_GPG_PASSPHRASE" )
|
||||
}
|
||||
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Ancillary tasks
|
||||
|
||||
tasks.register('showPublications') {
|
||||
doFirst {
|
||||
project.publishing.publications.each { publication ->
|
||||
println "Publication (${publication.name}): ${publication.groupId}:${publication.artifactId}:${publication.version}"
|
||||
publication.artifacts.each { artifact ->
|
||||
println " > ${artifact}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(PublishToMavenLocal).configureEach {
|
||||
doFirst {
|
||||
logger.lifecycle("PublishToMavenLocal ({})", publication.name)
|
||||
logger.lifecycle(" - {} : {} : {} ", publication.groupId, publication.artifactId, publication.pom.packaging)
|
||||
logger.lifecycle(" - artifacts ({})...", publication.artifacts.size())
|
||||
publication.artifacts.forEach {
|
||||
logger.lifecycle(" - artifact ({}) : {} ({})" , it.classifier, it.file, it.file.size())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(PublishToMavenRepository).configureEach {
|
||||
doFirst {
|
||||
logger.lifecycle("PublishToMavenRepository ({} : {})", publication.name, repository.name)
|
||||
logger.lifecycle(" - {} : {} : {} ", publication.groupId, publication.artifactId, publication.pom.packaging)
|
||||
logger.lifecycle(" - artifacts ({})...", publication.artifacts.size())
|
||||
publication.artifacts.forEach {
|
||||
logger.lifecycle(" - artifact ({}) : {} ({})" , it.classifier, it.file, it.file.size())
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
apply from: rootProject.file( 'gradle/base-information.gradle' )
|
||||
|
||||
task release {
|
||||
tasks.register('release') {
|
||||
mustRunAfter ':release:releaseChecks'
|
||||
enabled !project.ormVersion.isSnapshot
|
||||
}
|
||||
|
||||
task preVerifyRelease {
|
||||
tasks.register('preVerifyRelease') {
|
||||
dependsOn ':release:preVerifyRelease'
|
||||
}
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
|
||||
description = 'Integration for Agroal as a ConnectionProvider for Hibernate ORM'
|
||||
|
||||
apply from: rootProject.file( 'gradle/relocated-published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/group-relocation.gradle' )
|
||||
|
||||
dependencies {
|
||||
implementation project( ':hibernate-core' )
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
|
||||
description = 'Integration for c3p0 Connection pooling into Hibernate ORM'
|
||||
|
||||
apply from: rootProject.file( 'gradle/relocated-published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/group-relocation.gradle' )
|
||||
|
||||
dependencies {
|
||||
implementation project( ':hibernate-core' )
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
|
||||
description = 'Hibernate\'s community supported dialects'
|
||||
|
||||
apply from: rootProject.file( 'gradle/relocated-published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/group-relocation.gradle' )
|
||||
|
||||
dependencies {
|
||||
api project( ':hibernate-core' )
|
||||
|
|
|
@ -12,7 +12,9 @@ plugins {
|
|||
|
||||
description = 'Hibernate\'s core ORM functionality'
|
||||
|
||||
apply from: rootProject.file( 'gradle/relocated-published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/group-relocation.gradle' )
|
||||
|
||||
apply plugin: 'org.hibernate.orm.antlr'
|
||||
apply plugin: 'org.hibernate.matrix-test'
|
||||
|
||||
|
|
|
@ -7,7 +7,9 @@
|
|||
|
||||
description = 'Hibernate\'s entity version (audit/history) support'
|
||||
|
||||
apply from: rootProject.file( 'gradle/relocated-published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/group-relocation.gradle' )
|
||||
|
||||
apply plugin: 'org.hibernate.matrix-test'
|
||||
|
||||
dependencies {
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
|
||||
description = "Experimental extension to make it easier to compile applications into a GraalVM native image"
|
||||
|
||||
apply from: rootProject.file( 'gradle/relocated-published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/group-relocation.gradle' )
|
||||
|
||||
dependencies {
|
||||
//No need for transitive dependencies: this is all just metadata to be used as companion jar.
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
|
||||
description = 'Integration for HikariCP into Hibernate O/RM'
|
||||
|
||||
apply from: rootProject.file( 'gradle/relocated-published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/group-relocation.gradle' )
|
||||
|
||||
dependencies {
|
||||
implementation project( ':hibernate-core' )
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
description = 'Integration for javax.cache into Hibernate as a second-level caching service'
|
||||
|
||||
apply from: rootProject.file( 'gradle/relocated-published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/group-relocation.gradle' )
|
||||
|
||||
dependencies {
|
||||
api project( ':hibernate-core' )
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
|
||||
description = 'Integration for JDK JFR into Hibernate O/RM'
|
||||
|
||||
apply from: rootProject.file( 'gradle/relocated-published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/group-relocation.gradle' )
|
||||
|
||||
dependencies {
|
||||
implementation project( ':hibernate-core' )
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
description = 'Integration for Micrometer metrics into Hibernate as a metrics collection package'
|
||||
|
||||
apply from: rootProject.file( 'gradle/relocated-published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/group-relocation.gradle' )
|
||||
|
||||
dependencies {
|
||||
implementation project( ':hibernate-core' )
|
||||
|
|
|
@ -2,13 +2,10 @@ plugins {
|
|||
id 'java-platform'
|
||||
}
|
||||
|
||||
description = 'Gradle platform for Hibernate ORM'
|
||||
description = 'Platform (BOM) for Hibernate ORM dependencies'
|
||||
|
||||
apply from: rootProject.file( 'gradle/releasable.gradle' )
|
||||
apply from: rootProject.file( "gradle/base-information.gradle" )
|
||||
apply from: rootProject.file( "gradle/publishing-pom.gradle" )
|
||||
|
||||
apply plugin: 'signing'
|
||||
apply from: rootProject.file( "gradle/publishing.gradle" )
|
||||
|
||||
dependencies {
|
||||
constraints {
|
||||
|
@ -65,15 +62,13 @@ dependencies {
|
|||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
publishedArtifacts {
|
||||
from components.javaPlatform
|
||||
}
|
||||
}
|
||||
var publishingExtension = project.getExtensions().getByType(PublishingExtension) as PublishingExtension
|
||||
publishingExtension.publications.named("publishedArtifacts", MavenPublication) {
|
||||
from components.javaPlatform
|
||||
}
|
||||
|
||||
project( ":release" ).getTasks().named( "publishReleaseArtifacts" ).configure {
|
||||
tasks.register("publishReleaseArtifacts") {
|
||||
// mirror for `:release:publishReleaseArtifacts`
|
||||
dependsOn tasks.release
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,9 @@
|
|||
|
||||
description = 'Integrate support for Spatial/GIS data into Hibernate O/RM'
|
||||
|
||||
apply from: rootProject.file( 'gradle/relocated-published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/group-relocation.gradle' )
|
||||
|
||||
apply plugin: 'org.hibernate.matrix-test'
|
||||
|
||||
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
|
||||
description = 'Support for testing Hibernate ORM functionality'
|
||||
|
||||
apply from: rootProject.file( 'gradle/relocated-published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/group-relocation.gradle' )
|
||||
|
||||
dependencies {
|
||||
api project( ':hibernate-core' )
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
|
||||
description = 'Integration for Oracle UCP into Hibernate O/RM'
|
||||
|
||||
apply from: rootProject.file( 'gradle/relocated-published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/group-relocation.gradle' )
|
||||
|
||||
dependencies {
|
||||
implementation project( ':hibernate-core' )
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
|
||||
description = 'Hibernate\'s extensions for vector support'
|
||||
|
||||
apply from: rootProject.file( 'gradle/relocated-published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/group-relocation.gradle' )
|
||||
|
||||
dependencies {
|
||||
api project( ':hibernate-core' )
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
|
||||
description = 'Annotation Processor to generate JPA 2 static metamodel classes'
|
||||
|
||||
apply from: rootProject.file( 'gradle/relocated-published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/group-relocation.gradle' )
|
||||
apply plugin: 'org.hibernate.build.version-injection'
|
||||
|
||||
dependencies {
|
||||
|
|
|
@ -73,8 +73,10 @@ tasks.release.dependsOn tasks.publishPlugins
|
|||
// local publishing (SNAPSHOT testing)
|
||||
tasks.publish.dependsOn tasks.publishPlugins
|
||||
|
||||
// Make sure that the publishReleaseArtifacts task of the release module runs the release task of this sub module
|
||||
tasks.getByPath( ':release:publishReleaseArtifacts' ).dependsOn tasks.release
|
||||
tasks.register("publishReleaseArtifacts") {
|
||||
// mirror for `:release:publishReleaseArtifacts`
|
||||
dependsOn tasks.release
|
||||
}
|
||||
|
||||
// local publishing (SNAPSHOT testing)
|
||||
publishing {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
description = 'Maven plugin to integrate aspects of Hibernate into your build.'
|
||||
|
||||
apply from: rootProject.file( 'gradle/publishing-pom.gradle' )
|
||||
apply from: rootProject.file( 'gradle/java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/publishing.gradle' )
|
||||
|
||||
apply plugin: 'org.hibernate.build.maven-embedder'
|
||||
|
||||
|
@ -21,63 +21,60 @@ dependencies {
|
|||
implementation "org.apache.maven.shared:file-management:3.1.0"
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
publishedArtifacts(MavenPublication) {
|
||||
from components.java
|
||||
pom.withXml {
|
||||
asNode()
|
||||
.version
|
||||
.plus {
|
||||
packaging('maven-plugin')
|
||||
}
|
||||
asNode()
|
||||
.dependencies
|
||||
.dependency
|
||||
.findAll { dependency ->
|
||||
dependency.groupId.text().startsWith('org.apache.maven')
|
||||
}
|
||||
.each { dependency ->
|
||||
if (dependency.groupId.text().startsWith('org.apache.maven.shared')) {
|
||||
dependency.scope*.value = 'compile'
|
||||
} else {
|
||||
dependency.scope*.value = 'provided'
|
||||
}
|
||||
}
|
||||
asNode()
|
||||
.dependencies
|
||||
.dependency
|
||||
.findAll { dependency ->
|
||||
dependency.groupId.text().startsWith('org.hibernate.orm')
|
||||
}
|
||||
.each { dependency ->
|
||||
dependency.scope*.value = 'compile'
|
||||
}
|
||||
asNode()
|
||||
.dependencies
|
||||
.plus {
|
||||
def plugins = build().appendNode('plugins')
|
||||
def pluginPlugin = plugins.appendNode('plugin')
|
||||
pluginPlugin.appendNode('groupId', 'org.apache.maven.plugins')
|
||||
pluginPlugin.appendNode('artifactId', 'maven-plugin-plugin')
|
||||
pluginPlugin.appendNode('version', '3.15.0')
|
||||
def pluginConfiguration = pluginPlugin.appendNode('configuration')
|
||||
pluginConfiguration.appendNode('goalPrefix', 'plugin')
|
||||
pluginConfiguration.appendNode('outputDirectory', layout.buildDirectory.dir('generated/sources/plugin-descriptors/META-INF/maven').get().getAsFile().getAbsolutePath() )
|
||||
def invokerPlugin = plugins.appendNode('plugin');
|
||||
invokerPlugin.appendNode('groupId', 'org.apache.maven.plugins')
|
||||
invokerPlugin.appendNode('artifactId', 'maven-invoker-plugin')
|
||||
invokerPlugin.appendNode('version', '3.8.0')
|
||||
def invokerConfiguration = invokerPlugin.appendNode('configuration');
|
||||
invokerConfiguration.appendNode('debug', 'true');
|
||||
invokerConfiguration.appendNode('mavenExecutable', 'mvnw');
|
||||
def scriptVariables = invokerConfiguration.appendNode('scriptVariables');
|
||||
scriptVariables.appendNode('hibernateCoreJarPath', layout.buildDirectory.file('maven-embedder/maven-local/org/hibernate/orm/hibernate-core/' + project.version + '/hibernate-core-' + project.version + '.jar').get().getAsFile().getAbsolutePath())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var publishingExtension = project.getExtensions().getByType(PublishingExtension) as PublishingExtension
|
||||
publishingExtension.publications.named("publishedArtifacts") {
|
||||
from components.java
|
||||
|
||||
pom.withXml {
|
||||
asNode()
|
||||
.version
|
||||
.plus {
|
||||
packaging('maven-plugin')
|
||||
}
|
||||
asNode()
|
||||
.dependencies
|
||||
.dependency
|
||||
.findAll { dependency ->
|
||||
dependency.groupId.text().startsWith('org.apache.maven')
|
||||
}
|
||||
.each { dependency ->
|
||||
if (dependency.groupId.text().startsWith('org.apache.maven.shared')) {
|
||||
dependency.scope*.value = 'compile'
|
||||
} else {
|
||||
dependency.scope*.value = 'provided'
|
||||
}
|
||||
}
|
||||
asNode()
|
||||
.dependencies
|
||||
.dependency
|
||||
.findAll { dependency ->
|
||||
dependency.groupId.text().startsWith('org.hibernate.orm')
|
||||
}
|
||||
.each { dependency ->
|
||||
dependency.scope*.value = 'compile'
|
||||
}
|
||||
asNode()
|
||||
.dependencies
|
||||
.plus {
|
||||
def plugins = build().appendNode('plugins')
|
||||
def pluginPlugin = plugins.appendNode('plugin')
|
||||
pluginPlugin.appendNode('groupId', 'org.apache.maven.plugins')
|
||||
pluginPlugin.appendNode('artifactId', 'maven-plugin-plugin')
|
||||
pluginPlugin.appendNode('version', '3.15.0')
|
||||
def pluginConfiguration = pluginPlugin.appendNode('configuration')
|
||||
pluginConfiguration.appendNode('goalPrefix', 'plugin')
|
||||
pluginConfiguration.appendNode('outputDirectory', layout.buildDirectory.dir('generated/sources/plugin-descriptors/META-INF/maven').get().getAsFile().getAbsolutePath() )
|
||||
def invokerPlugin = plugins.appendNode('plugin');
|
||||
invokerPlugin.appendNode('groupId', 'org.apache.maven.plugins')
|
||||
invokerPlugin.appendNode('artifactId', 'maven-invoker-plugin')
|
||||
invokerPlugin.appendNode('version', '3.8.0')
|
||||
def invokerConfiguration = invokerPlugin.appendNode('configuration');
|
||||
invokerConfiguration.appendNode('debug', 'true');
|
||||
invokerConfiguration.appendNode('mavenExecutable', 'mvnw');
|
||||
def scriptVariables = invokerConfiguration.appendNode('scriptVariables');
|
||||
scriptVariables.appendNode('hibernateCoreJarPath', layout.buildDirectory.file('maven-embedder/maven-local/org/hibernate/orm/hibernate-core/' + project.version + '/hibernate-core-' + project.version + '.jar').get().getAsFile().getAbsolutePath())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Following tasks need to be performed:
|
||||
|
|
|
@ -8,7 +8,9 @@ import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis
|
|||
*/
|
||||
description = 'Hibernate compile-time tooling'
|
||||
|
||||
apply from: rootProject.file( 'gradle/relocated-published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
||||
apply from: rootProject.file( 'gradle/group-relocation.gradle' )
|
||||
|
||||
apply plugin: 'org.hibernate.build.version-injection'
|
||||
|
||||
//java {
|
||||
|
@ -144,60 +146,27 @@ compileTestJava {
|
|||
]
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
// relocation for the published artifacts based on the old groupId
|
||||
relocationPom(MavenPublication) {
|
||||
pom {
|
||||
name = 'hibernate-jpamodelgen - relocation'
|
||||
groupId = 'org.hibernate.orm'
|
||||
artifactId = 'hibernate-jpamodelgen'
|
||||
var publishingExtension = project.getExtensions().getByType(PublishingExtension) as PublishingExtension
|
||||
|
||||
publishingExtension.publications.named("groupRelocation", MavenPublication) {
|
||||
// org.hibernate:hibernate-jpamodelgen -> org.hibernate.orm:hibernate-processor
|
||||
pom {
|
||||
artifactId = 'hibernate-jpamodelgen'
|
||||
name = 'hibernate-jpamodelgen (relocated)'
|
||||
}
|
||||
}
|
||||
|
||||
publishingExtension.publications.register("renameRelocation", MavenPublication) {
|
||||
// org.hibernate.orm:hibernate-jpamodelgen -> org.hibernate.orm:hibernate-processor
|
||||
pom {
|
||||
artifactId = 'hibernate-jpamodelgen'
|
||||
name = 'hibernate-jpamodelgen (relocated)'
|
||||
|
||||
distributionManagement {
|
||||
relocation {
|
||||
groupId = project.group
|
||||
artifactId = project.name
|
||||
version = project.version
|
||||
|
||||
description = project.description
|
||||
url = 'https://hibernate.org/orm'
|
||||
|
||||
organization {
|
||||
name = 'Hibernate.org'
|
||||
url = 'https://hibernate.org'
|
||||
}
|
||||
|
||||
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.'
|
||||
distribution = 'repo'
|
||||
}
|
||||
}
|
||||
|
||||
scm {
|
||||
url = 'https://github.com/hibernate/hibernate-orm'
|
||||
connection = 'scm:git:https://github.com/hibernate/hibernate-orm.git'
|
||||
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'
|
||||
}
|
||||
}
|
||||
|
||||
issueManagement {
|
||||
system = 'jira'
|
||||
url = 'https://hibernate.atlassian.net/browse/HHH'
|
||||
}
|
||||
|
||||
distributionManagement {
|
||||
relocation {
|
||||
groupId = 'org.hibernate.orm'
|
||||
artifactId = project.name
|
||||
version = project.version
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue