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: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'
project.version = '3.2.14-SNAPSHOT'
......@@ -13,6 +14,8 @@ wrapper {
distributionType = Wrapper.DistributionType.ALL
}
final isSnapshot = project.version.endsWith("-SNAPSHOT")
sourceCompatibility = 7
targetCompatibility = 7
......@@ -64,56 +67,57 @@ compileJava {
dependsOn = ['writeVersion']
}
if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) {
apply plugin: 'signing'
signing {
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'SableCC - Stups fork'
description = 'This version of SableCC enriches the abstract syntax tree with information about tokens.'
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'
}
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
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'
}
pom.project {
name 'SableCC - Stups fork'
packaging 'jar'
// optionally artifactId can be defined here
description 'This version of SableCC enriches the abstract syntax tree with information about tokens.'
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'
developers {
developer {
id = 'bendisposto'
name = 'Jens Bendisposto'
email = 'jens@bendisposto.de'
}
}
}
}
}
developers {
developer {
id 'bendisposto'
name 'Jens Bendisposto'
email 'jens@bendisposto.de'
}
}
repositories {
maven {
final releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
final snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url isSnapshot ? snapshotsRepoUrl : releasesRepoUrl
if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) {
credentials {
username project.ossrhUsername
password project.ossrhPassword
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
Markdown is supported
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