Commit 439fa442 authored by dgelessus's avatar dgelessus
Browse files

Migrate to Gradle maven-publish plugin from deprecated maven plugin

parent 2951f580
Pipeline #39667 passed with stages
in 2 minutes and 24 seconds
apply plugin: 'application' apply plugin: 'application'
apply plugin: 'java' apply plugin: 'java'
apply plugin: 'eclipse' apply plugin: 'eclipse'
apply plugin: 'maven' apply plugin: 'maven-publish'
apply plugin: 'signing'
project.version = '3.2.14-SNAPSHOT' project.version = '3.2.14-SNAPSHOT'
...@@ -13,6 +14,8 @@ wrapper { ...@@ -13,6 +14,8 @@ wrapper {
distributionType = Wrapper.DistributionType.ALL distributionType = Wrapper.DistributionType.ALL
} }
final isSnapshot = project.version.endsWith("-SNAPSHOT")
sourceCompatibility = 7 sourceCompatibility = 7
targetCompatibility = 7 targetCompatibility = 7
...@@ -64,56 +67,57 @@ compileJava { ...@@ -64,56 +67,57 @@ compileJava {
dependsOn = ['writeVersion'] dependsOn = ['writeVersion']
} }
if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) { publishing {
publications {
apply plugin: 'signing' mavenJava(MavenPublication) {
from components.java
signing { artifact sourcesJar
sign configurations.archives artifact javadocJar
}
uploadArchives { pom {
repositories { name = 'SableCC - Stups fork'
mavenDeployer { description = 'This version of SableCC enriches the abstract syntax tree with information about tokens.'
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } url = 'https://github.com/bendisposto/sablecc-stups'
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { licenses {
authentication(userName: ossrhUsername, password: ossrhPassword) license {
name = 'GNU Lesser General Public License, Version 2.1'
url = 'http://www.gnu.org/licenses/lgpl-2.1.html'
}
} }
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { scm {
authentication(userName: ossrhUsername, password: ossrhPassword) connection = 'scm:git:git://github.com/bendisposto/sablecc-stups.git'
developerConnection = 'scm:git:git@github.com:bendisposto/sablecc-stups.git'
url = 'https://github.com/bendisposto/sablecc-stups'
} }
pom.project { developers {
name 'SableCC - Stups fork' developer {
packaging 'jar' id = 'bendisposto'
// optionally artifactId can be defined here name = 'Jens Bendisposto'
description 'This version of SableCC enriches the abstract syntax tree with information about tokens.' email = 'jens@bendisposto.de'
url 'https://github.com/bendisposto/sablecc-stups'
licenses {
license {
name 'GNU Lesser General Public License, Version 2.1'
url 'http://www.gnu.org/licenses/lgpl-2.1.html'
}
}
scm {
connection 'scm:git:git://github.com/bendisposto/sablecc-stups.git'
developerConnection 'scm:git:git@github.com:bendisposto/sablecc-stups.git'
url 'https://github.com/bendisposto/sablecc-stups'
} }
}
}
}
}
repositories {
developers { maven {
developer { final releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
id 'bendisposto' final snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
name 'Jens Bendisposto' url isSnapshot ? snapshotsRepoUrl : releasesRepoUrl
email 'jens@bendisposto.de' if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) {
} credentials {
} username project.ossrhUsername
password project.ossrhPassword
} }
} }
} }
} }
} }
signing {
sign publishing.publications.mavenJava
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment