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')]) {
|
||||
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 {
|
||||
id 'java-library'
|
||||
id 'jacoco'
|
||||
|
||||
id 'maven-publish'
|
||||
id 'signing'
|
||||
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
|
||||
}
|
||||
|
||||
// Load custom properties
|
||||
|
|
|
|||
|
|
@ -1,25 +1,21 @@
|
|||
// Documentation: https://jreleaser.org/guide/latest/examples/maven/maven-central.html#_gradle
|
||||
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'signing'
|
||||
|
||||
publishing {
|
||||
nexusPublishing {
|
||||
repositories {
|
||||
maven {
|
||||
def snapshotsRepoUrl = 'http://oss.sonatype.org/content/repositories/snapshots/'
|
||||
def releaseRepoUrl = 'http://oss.sonatype.org/service/local/staging/deploy/maven2/'
|
||||
url = project.hasProperty('release') ? releaseRepoUrl : snapshotsRepoUrl
|
||||
sonatype {
|
||||
//nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
|
||||
//snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/"))
|
||||
|
||||
credentials {
|
||||
def repositoryUsername = project.hasProperty('mavenCentralUsername') ? mavenCentralUsername : "unknown"
|
||||
project.logger.info("Setting Maven Central Credentials: ${repositoryUsername}")
|
||||
def repositoryUsername = project.hasProperty('mavenCentralUsername') ? mavenCentralUsername : "unknown"
|
||||
project.logger.info("Setting Maven Central Credentials: ${repositoryUsername}")
|
||||
|
||||
username(repositoryUsername)
|
||||
password( project.hasProperty('mavenCentralPassword') ? mavenCentralPassword : "unknown")
|
||||
}
|
||||
username = repositoryUsername
|
||||
password = project.hasProperty('mavenCentralPassword') ? mavenCentralPassword : "unknown"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
from components.java
|
||||
|
|
@ -55,8 +51,7 @@ publishing {
|
|||
|
||||
signing {
|
||||
required { hasProperty("signing.secretKeyRingFile") }
|
||||
//sign publishing.publications.mavenJava
|
||||
sign configurations.archives
|
||||
sign publishing.publications.mavenJava
|
||||
}
|
||||
|
||||
// Generate version.txt
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue