Skip to content
Snippets Groups Projects
Commit 9cac88cb authored by dgelessus's avatar dgelessus
Browse files

Migrate to Gradle maven-publish plugin from deprecated maven plugin

parent cbc82a2c
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ publish:
- openssl aes-256-cbc -pass "env:ENCRYPTION_PASSWORD" -d -in secring.gpg.enc -out secring.gpg
- openssl aes-256-cbc -pass "env:ENCRYPTION_PASSWORD" -d -in pubring.gpg.enc -out pubring.gpg
- openssl aes-256-cbc -pass "env:ENCRYPTION_PASSWORD" -d -in gradle.properties.enc -out gradle.properties
- ./gradlew ${GRADLE_OPTIONS} uploadArchives
- ./gradlew ${GRADLE_OPTIONS} publish
only:
- master@general/stups/tlc4b
- develop@general/stups/tlc4b
plugins {
id 'java'
id 'eclipse'
id 'maven'
id 'jacoco'
id "maven-publish"
id "signing"
id "de.undercouch.download" version "3.4.3"
}
project.version = '1.0.5-SNAPSHOT'
project.group = 'de.hhu.stups'
final isSnapshot = project.version.endsWith("-SNAPSHOT")
project.sourceCompatibility = '1.7'
project.targetCompatibility = '1.7'
......@@ -47,6 +50,11 @@ dependencies {
testCompile (group: 'de.hhu.stups', name: 'tla2bAST', version: '1.1.0')
}
java {
withSourcesJar()
withJavadocJar()
}
jacoco {
toolVersion = "0.8.7"
reportsDir = file("$buildDir/JacocoReports")
......@@ -108,75 +116,55 @@ task createJar(type: Jar, dependsOn: build){
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) {
apply plugin: 'signing'
signing {
sign configurations.archives
}
javadoc {
failOnError = false
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
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)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'TLC integration into ProB'
packaging 'jar'
// optionally artifactId can be defined here
description "Use the TLC model checker within ProB."
url 'https://github.com/hhu-stups/tlc4b'
pom {
name = "TLC integration into ProB"
description = "Use the TLC model checker within ProB."
url = "https://github.com/hhu-stups/tlc4b"
licenses {
license {
name 'Eclipse Public License, Version 2.1'
url 'https://www.eclipse.org/legal/epl-v10.html'
name = "Eclipse Public License, Version 2.1"
url = "https://www.eclipse.org/legal/epl-v10.html"
}
}
scm {
connection 'scm:git:git://github.com/hhu-stups/tlc4b.git'
developerConnection 'scm:git:git@github.com:hhu-stups/tlc4b.git'
url 'https://github.com/bendisposto/hhu-stups/tlc4b'
connection = "scm:git:git://github.com/hhu-stups/tlc4b.git"
developerConnection = "scm:git:git@github.com:hhu-stups/tlc4b.git"
url = "https://github.com/bendisposto/hhu-stups/tlc4b"
}
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