Skip to content
Snippets Groups Projects
Commit 439fa442 authored by dgelessus's avatar dgelessus
Browse files

Migrate to Gradle maven-publish plugin from deprecated maven plugin

parent 2951f580
No related branches found
No related tags found
No related merge requests found
Pipeline #39667 passed
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
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
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'
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'
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'
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'
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
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment