Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use gradle-nexus.publish-plugin to publish to Nexus #116

Merged
merged 1 commit into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ node('rhel7'){
if (isSnapshot) {
sh "./gradlew publish -PnexusUser=${USER} -PnexusPassword=${PASSWORD}"
} else {
sh "./gradlew publish closeAndReleaseRepository -PnexusUser=${USER} -PnexusPassword=${PASSWORD}"
currentBuild.keepLog = true
currentBuild.description = "${version}"
sh "./gradlew publish closeAndReleaseStagingRepository -PnexusUser=${USER} -PnexusPassword=${PASSWORD}"
}
}
}
Expand Down
27 changes: 10 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
plugins {
id "org.jetbrains.intellij" version "1.1.4"
id 'maven-publish'
id 'io.codearte.nexus-staging' version "0.22.0"
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
}

repositories {
Expand All @@ -14,7 +14,6 @@ apply plugin: 'idea'
apply plugin: 'org.jetbrains.intellij'
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'io.codearte.nexus-staging'

intellij {
version = ideaVersion //for a full list of IntelliJ IDEA releases please see https://www.jetbrains.com/intellij-repository/releases
Expand Down Expand Up @@ -51,11 +50,16 @@ group 'com.redhat.devtools.intellij'
version projectVersion // Plugin version


nexusStaging {
serverUrl = 'https://repository.jboss.org/nexus/service/local/'
username = nexusUser
password = nexusPassword
nexusPublishing {
packageGroup = 'JBoss Releases Staging Profile'
repositories {
jbossNexus {
nexusUrl = uri("https://repository.jboss.org/nexus/service/local/")
snapshotRepositoryUrl = uri("https://repository.jboss.org/nexus/content/repositories/snapshots/")
username = nexusUser // defaults to project.properties["myNexusUsername"]
password = nexusPassword // defaults to project.properties["myNexusPassword"]
}
}
}

def testJarFile = file("$buildDir/libs/intellij-common-${projectVersion}-test.jar")
Expand Down Expand Up @@ -94,15 +98,4 @@ publishing {
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://repository.jboss.org/nexus/service/local/staging/deploy/maven2"
def snapshotsRepoUrl = "https://repository.jboss.org/nexus/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = nexusUser
password = nexusPassword
}
}
}
}