HHH-8146 - Update to use maven-publishing plugin

This commit is contained in:
Steve Ebersole 2013-04-16 18:25:20 -05:00
parent 079fd4ac01
commit 8eeef7af3b
9 changed files with 124 additions and 63 deletions

View File

@ -21,7 +21,7 @@ buildscript {
mavenRepo name: "jboss-snapshots", url: "http://snapshots.jboss.org/maven2/"
}
dependencies {
classpath 'org.hibernate.build.gradle:gradle-upload-auth-plugin:1.1.1'
classpath 'org.hibernate.build.gradle:gradle-maven-publish-auth:2.0.0'
}
}
@ -55,6 +55,14 @@ idea {
}
}
// Used in POM customization. Each sub-project overrides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def pomName() {
return "A Hibernate O/RM module"
}
def pomDescription() {
return "A module of the Hibernate O/RM project"
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
subprojects { subProject ->
apply plugin: 'idea'
@ -69,8 +77,8 @@ subprojects { subProject ->
buildDir = "target"
if ( ! subProject.name.startsWith( 'release' ) && ! subProject.name.startsWith( 'documentation' ) ) {
apply plugin: 'java'
apply plugin: 'maven' // for install task as well as deploy dependencies
apply plugin: 'uploadAuth'
apply plugin: 'maven-publish'
apply plugin: 'maven-publish-auth'
apply plugin: 'osgi'
apply from: "../utilities.gradle"
@ -91,16 +99,12 @@ subprojects { subProject ->
hibernateJpaModelGenTool {
description = "Dependencies for running the Hibernate JPA Metamodel Generator AnnotationProcessor tool"
}
deployerJars {
description = 'Jars needed for doing deployment to JBoss Nexus repo'
}
jaxb {
description = 'Dependencies for running ant xjc (jaxb class generation)'
}
configurations {
all*.exclude group: 'xml-apis', module: 'xml-apis'
}
}
// appropriately inject the common dependencies into each sub-project
@ -129,8 +133,6 @@ subprojects { subProject ->
}
jaxb( libraries.jaxb2_basics )
jaxb( libraries.jaxb2_ant )
deployerJars "org.apache.maven.wagon:wagon-http:1.0"
}
// mac-specific stuff ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -146,7 +148,7 @@ subprojects { subProject ->
sourceCompatibility = rootProject.javaLanguageLevel
task compile
compile.dependsOn compileJava, compileTestJava
compile.dependsOn compileJava, processResources, compileTestJava, processTestResources
sourceSets.main {
compileClasspath += configurations.provided
@ -273,9 +275,6 @@ subprojects { subProject ->
}
} )
assemble.doLast( { install } )
uploadArchives.dependsOn install
idea {
module {
iml {
@ -343,55 +342,59 @@ subprojects { subProject ->
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// elements used to customize the generated POM used during upload
def pomConfig = {
name 'A Hibernate O/RM Module'
description 'A module of the Hibernate O/RM project'
url 'http://hibernate.org'
organization {
name 'Hibernate.org'
url 'http://hibernate.org'
}
issueManagement {
system 'jira'
url 'http://opensource.atlassian.com/projects/hibernate/browse/HHH'
}
scm {
url "http://github.com/hibernate/hibernate-core"
connection "scm:git:http://github.com/hibernate/hibernate-core.git"
developerConnection "scm:git:git@github.com:hibernate/hibernate-core.git"
}
licenses {
license {
name 'GNU Lesser General Public License'
url 'http://www.gnu.org/licenses/lgpl-2.1.html'
comments 'See discussion at http://hibernate.org/license for more details.'
distribution 'repo'
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
pom.withXml {
def root = asNode();
root.appendNode( 'name', subProject.pomName() )
root.appendNode( 'description', subProject.pomDescription() )
root.appendNode( 'url', 'http://hibernate.org' )
def org = root.appendNode( 'organization' )
org.appendNode( 'name', 'Hibernate.org' )
org.appendNode( 'url', 'http://hibernate.org' )
def jira = root.appendNode( 'issueManagement' )
jira.appendNode( 'system', 'jira' )
jira.appendNode( 'url', 'https://hibernate.atlassian.net/browse/HHH' )
def scm = root.appendNode( 'scm' )
scm.appendNode( 'url', 'http://github.com/hibernate/hibernate-orm' )
scm.appendNode( 'connection', 'scm:git:http://github.com/hibernate/hibernate-orm.git' )
scm.appendNode( 'developerConnection', 'scm:git:git@github.com:hibernate/hibernate-orm.git' )
def license = root.appendNode( 'licenses' ).appendNode( 'license' );
license.appendNode( 'name', 'GNU Lesser General Public License' )
license.appendNode( 'url', 'http://www.gnu.org/licenses/lgpl-2.1.html' )
license.appendNode( 'comments', 'See discussion at http://hibernate.org/license for more details.' )
license.appendNode( 'distribution', 'repo' )
def dev = root.appendNode( 'developers' ).appendNode( 'developer' );
dev.appendNode( 'id', 'hibernate-team' )
dev.appendNode( 'name', 'The Hibernate Development Team' )
dev.appendNode( 'organization', 'Hibernate.org' )
dev.appendNode( 'organizationUrl', 'http://hibernate.org' )
}
}
}
developers {
developer {
id 'hibernate-team'
name 'The Hibernate Development Team'
organization 'Hibernate.org'
organizationUrl 'http://hibernate.org'
repositories {
maven {
if ( subProject.version.endsWith( 'SNAPSHOT' ) ) {
name 'jboss-snapshots-repository'
url 'https://repository.jboss.org/nexus/content/repositories/snapshots'
}
else {
name 'jboss-releases-repository'
url 'https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/'
}
}
}
}
subProject.ext.basePomConfig = pomConfig
configure(install.repositories.mavenInstaller) {
pom.project pomConfig
}
uploadArchives {
repositories.mavenDeployer {
name = 'jbossDeployer'
configuration = configurations.deployerJars
pom.project pomConfig
repository(id: "jboss-releases-repository", url: "https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/")
snapshotRepository(id: "jboss-snapshots-repository", url: "https://repository.jboss.org/nexus/content/repositories/snapshots")
generatePomFileForMavenJavaPublication {
destination = file("$buildDir/generated-pom.xml")
}
}
@ -399,12 +402,6 @@ subprojects { subProject ->
from sourceSets.main.allSource
classifier = 'sources'
}
artifacts {
archives sourcesJar
}
uploadArchives.dependsOn sourcesJar
}
}

View File

@ -10,6 +10,14 @@ dependencies {
testCompile project( ':hibernate-testing' )
}
def pomName() {
return 'Hibernate/c3p0 Integration'
}
def pomDescription() {
return 'Integration for c3p0 Connection pooling into Hibernate O/RM'
}
jar {
manifest {
instruction 'Bundle-Description', 'Hibernate ORM C3P0'

View File

@ -33,6 +33,14 @@ dependencies {
}
def pomName() {
return 'Core Hibernate O/RM functionality'
}
def pomDescription() {
return 'The core O/RM functionality as provided by Hibernate'
}
manifest.mainAttributes(
'Main-Class': 'org.hibernate.Version'
)

View File

@ -5,6 +5,14 @@ dependencies {
testCompile project( ':hibernate-testing' )
}
def pomName() {
return 'Hibernate/Ehcache Integration'
}
def pomDescription() {
return 'Integration for Ehcache into Hibernate as a second-level caching service'
}
jar {
manifest {
instruction 'Bundle-Description', 'Hibernate ORM EHCache'

View File

@ -24,6 +24,14 @@ dependencies {
// testRuntime( "org.glassfish.web:el-impl:2.1.2-b04" )
}
def pomName() {
return 'Hibernate JPA Support'
}
def pomDescription() {
return 'Hibernate O/RM implementation of the JPA specification'
}
jar {
manifest {
instruction 'Bundle-Description', 'Hibernate ORM JPA Entity Manager'

View File

@ -10,6 +10,14 @@ dependencies {
testRuntime( libraries.javassist )
}
def pomName() {
return 'Entity versioning support'
}
def pomDescription() {
return 'Entity versioning support'
}
sourceSets {
main {
ext.generatedJpaMetamodelSrcDir = file( "${buildDir}/generated-src/jpamodelgen/${name}" )

View File

@ -16,6 +16,14 @@ dependencies {
testCompile ('mysql:mysql-connector-java:5.1.17')
}
def pomName() {
return 'Hibernate/Infinispan Integration'
}
def pomDescription() {
return 'Integration for Infinispan into Hibernate as a second-level caching service'
}
test {
systemProperties['java.net.preferIPv4Stack'] = true
systemProperties['jgroups.ping.timeout'] = 500

View File

@ -4,6 +4,14 @@ dependencies {
compile( "org.osgi:org.osgi.core:4.3.0" )
}
def pomName() {
return 'Hibernate OSGi Support'
}
def pomDescription() {
return 'Support for running Hibernate O/RM in OSGi environments'
}
jar {
manifest {
instruction 'Bundle-Activator', 'org.hibernate.osgi.HibernateBundleActivator'

View File

@ -4,6 +4,14 @@ dependencies {
testCompile project( ':hibernate-testing' )
}
def pomName() {
return 'Hibernate/Proxool Integration'
}
def pomDescription() {
return 'Integration for Proxool Connection pooling into Hibernate O/RM'
}
jar {
manifest {
instruction 'Bundle-Description', 'Hibernate ORM Proxool'