diff --git a/README.md b/README.md index 922e064..6cba3b3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Testerra AzureDevOps Connector

+ @@ -27,7 +28,7 @@ It will register automatically by using Testerra `ModuleHook`, but you have to p ### Requirements -* Testerra in Version: `1.0-RC-30` +![Maven Central](https://img.shields.io/maven-central/v/io.testerra/core/1.0-RC-32?label=Testerra) ### Usage @@ -35,7 +36,7 @@ Include the following dependency in your project. Gradle: ````groovy -implementation 'eu.tsystems.mms.tic.testerra:azure-devops-connector:1.0-RC-2' +implementation 'eu.tsystems.mms.tic.testerra:azure-devops-connector:1.0' ```` Maven: @@ -43,7 +44,7 @@ Maven: eu.tsystems.mms.tic.testerra azure-devops-connector - 1.0-RC-2 + 1.0 ```` @@ -81,28 +82,24 @@ public void test_case_01() { ## Publication -### ... to a Maven repo +This module is deployed and published to Maven Central. All JAR files are signed via Gradle signing plugin. -_Publishing to local repo_ -```shell -gradle publishToMavenLocal -``` +The following properties have to be set via command line or ``~/.gradle/gradle.properties`` -_Publishing to remote repo_ -```shell -gradle publish -DdeployUrl= -DdeployUsername= -DdeployPassword= -``` +| Property | Description | +| ----------------------------- | --------------------------------------------------- | +| `moduleVersion` | Version of deployed module, default is `1-SNAPSHOT` | +| `deployUrl` | Maven repository URL | +| `deployUsername` | Maven repository username | +| `deployPassword` | Maven repository password | +| `signing.keyId` | GPG private key ID (short form) | +| `signing.password` | GPG private key password | +| `signing.secretKeyRingFile` | Path to GPG private key | -_Set a custom version_ -```shell -gradle publish -DmoduleVersion= -``` -### ... to GitHub Packages - -Some hints for using GitHub Packages as Maven repository - -* Deploy URL is https://maven.pkg.github.com/OWNER/REPOSITRY -* As password generate an access token and grant permissions to ``write:packages`` (Settings -> Developer settings -> Personal access token) +If all properties are set, call the following to build, deploy and release this module: +````shell +gradle publish closeAndReleaseRepository +```` ## Code of Conduct diff --git a/build.gradle b/build.gradle index eef8be2..968dd2a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,16 @@ +plugins { + id "io.codearte.nexus-staging" version "0.30.0" +} + apply plugin: 'java' apply plugin: 'maven' apply plugin: 'maven-publish' +apply plugin: 'signing' +apply plugin: 'io.codearte.nexus-staging' ext { // Minimum required Testerra version - testerraCompileVersion = '1.0-RC-30' + testerraCompileVersion = '1.0-RC-32' // Unit tests use the latest Testerra version testerraTestVersion = '[1.0-RC,2-SNAPSHOT)' @@ -14,7 +20,7 @@ ext { moduleVersion = System.getProperty('moduleVersion') } - group 'eu.tsystems.mms.tic.testerra' + group 'io.testerra' version moduleVersion } @@ -22,8 +28,8 @@ ext { apply from: rootProject.file('publish.gradle') dependencies { - compileOnly 'eu.tsystems.mms.tic.testerra:core:' + testerraCompileVersion - implementation 'eu.tsystems.mms.tic.testerra:surefire-connector:' + testerraCompileVersion + compileOnly 'io.testerra:core:' + testerraCompileVersion + implementation 'io.testerra:surefire-connector:' + testerraCompileVersion implementation 'org.apache.commons:commons-lang3:3.9' implementation 'org.apache.httpcomponents:httpcore:4.4.13' @@ -34,8 +40,8 @@ dependencies { // Better JSON mapper for Jersey implementation 'com.owlike:genson:1.6' - testImplementation 'eu.tsystems.mms.tic.testerra:core:' + testerraTestVersion - testImplementation 'eu.tsystems.mms.tic.testerra:report:' + testerraTestVersion + testImplementation 'io.testerra:core:' + testerraTestVersion + testImplementation 'io.testerra:report:' + testerraTestVersion } diff --git a/publish.gradle b/publish.gradle index 4a3447d..c7cd436 100644 --- a/publish.gradle +++ b/publish.gradle @@ -2,94 +2,119 @@ * Maven publishing configuration * */ -// Maven basis attributes +// Maven pom.xml attributes ext { - libraryName = 'Testerra' - artifact = project.getName().toLowerCase() - packagingType = 'jar' + libraryName = 'Testerra TeamCity Connector' + packagingType = 'jar' - libraryDescription = "Testerra ${project.getName()} module" + siteUrl = 'https://testerra.io' + gitUrl = 'scm:git:git://github.com/telekom/testerra-azure-devops-connector.git' + gitHttpsUrl = 'https://github.com/telekom/testerra-azure-devops-connector/' - siteUrl = 'https://testerra.io' - gitUrl = 'https://github.com/telekom/testerra-selenoid-connector.git' - issueUrl = 'https://github.com/telekom/testerra-selenoid-connector/issues' + developerId = 'MMS' + developerName = 'Testerra Team T-Systems MMS' + developerEmail = 'testerra@t-systems-mms.com' + developerOrganization = 'T-Systems MMS' + developerOrganizationUrl = 'https://www.t-systems-mms.com/' - developerId = 'MMS' - developerName = 'Testerra Team T-Systems MMS' - developerEmail = 'testerra@t-systems-mms.com' - - licenseName = 'The Apache Software License, Version 2.0' - licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt' - allLicenses = ["Apache-2.0"] + licenseName = 'The Apache Software License, Version 2.0' + licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt' + allLicenses = ["Apache-2.0"] } -// Set up the Maven publication. -install { - repositories.mavenInstaller { - // This generates POM.xml with proper parameters - pom.project { - packaging packagingType - groupId group - artifactId artifact - - // Add your description here - name libraryName - description libraryDescription - url siteUrl - - // Set your license - licenses { - license { - name licenseName - url licenseUrl - } - } - developers { - developer { - id developerId - name developerName - email developerEmail - } - } - scm { - connection gitUrl - developerConnection gitUrl - url siteUrl - } - - } - } +nexusStaging { + serverUrl = "https://s01.oss.sonatype.org/service/local/" + packageGroup = "io.testerra" + username = System.getProperty("deployUsername") + password = System.getProperty("deployPassword") } + // Publish to a Maven repository allprojects { - publishing { + def libraryDescription = "Testerra test automation framework - ${project.getName()} module" + + javadoc { + // Support JDK 8 annotations + options.tags = [ + "implNote:a:Implementation Note:", + "apiNote:a:API Note:", + "implSpec:a:Implementation Requirements:" + ] + // Prevent errors during generation + options.addStringOption('Xdoclint:none', '-quiet') + } task sourcesJar(type: Jar, dependsOn: classes) { - archiveClassifier.set('sources') - from sourceSets.main.allSource + archiveClassifier.set('sources') + from sourceSets.main.allSource } - artifacts { - archives sourcesJar + task javadocJar(type: Jar) { + archiveClassifier.set('javadoc') + from javadoc } - publications { - mavenJava(MavenPublication) { - from components.java - artifact sourcesJar - } + artifacts { + archives sourcesJar + archives javadocJar } - repositories { - maven { - url System.getProperty("deployUrl", "none") - credentials { - username System.getProperty("deployUsername", "none") - password System.getProperty("deployPassword", "none") + publishing { + + publications { + mavenJava(MavenPublication) { + from components.java + artifact sourcesJar + artifact javadocJar + + // Custom pom + pom { + + name = libraryName + description = libraryDescription + url = siteUrl + + licenses { + license { + name = licenseName + url = licenseUrl + } + } + + developers { + developer { + id = developerId + name = developerName + email = developerEmail + organization = developerOrganization + organizationUrl = developerOrganizationUrl + } + } + + scm { + connection = gitUrl + developerConnection = gitUrl + url = gitHttpsUrl + } + } + } } - } + + repositories { + maven { + url System.getProperty("deployUrl", "none") + credentials { + username System.getProperty("deployUsername", "none") + password System.getProperty("deployPassword", "none") + } + } + } + + signing { + sign publishing.publications.mavenJava + } + } - } }