Fixing nexus upload issue
This commit is contained in:
parent
9c018ca242
commit
6f916edc20
3 changed files with 19 additions and 17 deletions
5
Jenkinsfile
vendored
5
Jenkinsfile
vendored
|
|
@ -37,7 +37,10 @@ pipeline {
|
||||||
configFileProvider([configFile(fileId: '70cb2022-0bc2-4b25-98a4-e1526dbf2735', variable: 'GRADLE_PROPERTIES')]) {
|
configFileProvider([configFile(fileId: '70cb2022-0bc2-4b25-98a4-e1526dbf2735', variable: 'GRADLE_PROPERTIES')]) {
|
||||||
sh './gradlew ${gradleParams} publishToMavenLocal'
|
sh './gradlew ${gradleParams} publishToMavenLocal'
|
||||||
|
|
||||||
sh './gradlew ${gradleParams} -Prelease -PcustomProperties=${GRADLE_PROPERTIES} publish'
|
sh './gradlew ${gradleParams} -Prelease -PcustomProperties=${GRADLE_PROPERTIES} ' +
|
||||||
|
'publishToSonatype ' +
|
||||||
|
//'closeAndReleaseSonatypeStagingRepository'
|
||||||
|
'closeSonatypeStagingRepository'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'java-library'
|
id 'java-library'
|
||||||
id 'jacoco'
|
id 'jacoco'
|
||||||
|
|
||||||
|
id 'maven-publish'
|
||||||
|
id 'signing'
|
||||||
|
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load custom properties
|
// Load custom properties
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,21 @@
|
||||||
// Documentation: https://jreleaser.org/guide/latest/examples/maven/maven-central.html#_gradle
|
// Documentation: https://jreleaser.org/guide/latest/examples/maven/maven-central.html#_gradle
|
||||||
|
|
||||||
apply plugin: 'maven-publish'
|
nexusPublishing {
|
||||||
apply plugin: 'signing'
|
|
||||||
|
|
||||||
publishing {
|
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
sonatype {
|
||||||
def snapshotsRepoUrl = 'http://oss.sonatype.org/content/repositories/snapshots/'
|
//nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
|
||||||
def releaseRepoUrl = 'http://oss.sonatype.org/service/local/staging/deploy/maven2/'
|
//snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/"))
|
||||||
url = project.hasProperty('release') ? releaseRepoUrl : snapshotsRepoUrl
|
|
||||||
|
|
||||||
credentials {
|
def repositoryUsername = project.hasProperty('mavenCentralUsername') ? mavenCentralUsername : "unknown"
|
||||||
def repositoryUsername = project.hasProperty('mavenCentralUsername') ? mavenCentralUsername : "unknown"
|
project.logger.info("Setting Maven Central Credentials: ${repositoryUsername}")
|
||||||
project.logger.info("Setting Maven Central Credentials: ${repositoryUsername}")
|
|
||||||
|
|
||||||
username(repositoryUsername)
|
username = repositoryUsername
|
||||||
password( project.hasProperty('mavenCentralPassword') ? mavenCentralPassword : "unknown")
|
password = project.hasProperty('mavenCentralPassword') ? mavenCentralPassword : "unknown"
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
mavenJava(MavenPublication) {
|
mavenJava(MavenPublication) {
|
||||||
from components.java
|
from components.java
|
||||||
|
|
@ -55,8 +51,7 @@ publishing {
|
||||||
|
|
||||||
signing {
|
signing {
|
||||||
required { hasProperty("signing.secretKeyRingFile") }
|
required { hasProperty("signing.secretKeyRingFile") }
|
||||||
//sign publishing.publications.mavenJava
|
sign publishing.publications.mavenJava
|
||||||
sign configurations.archives
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate version.txt
|
// Generate version.txt
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue