Skip to content

Commit

Permalink
maven publication updated
Browse files Browse the repository at this point in the history
  • Loading branch information
bgalek committed Aug 20, 2021
1 parent b518761 commit feed7de
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 55 deletions.
16 changes: 2 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,10 @@ jobs:
java-version: 1.8

- name: Publish to maven central
run: |
./gradlew uploadArchives \
-PnexusUsername=${SONATYPE_USERNAME} \
-PnexusPassword=${SONATYPE_PASSWORD}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PRIVATE_KEY_PASSWORD: ${{ secrets.GPG_PRIVATE_KEY_PASSWORD }}

- name: Publish to maven central
run: |
./gradlew closeRepository promoteRepository \
-PnexusUsername=${SONATYPE_USERNAME} \
-PnexusPassword=${SONATYPE_PASSWORD}
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PRIVATE_KEY_PASSWORD: ${{ secrets.GPG_PRIVATE_KEY_PASSWORD }}
81 changes: 40 additions & 41 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ buildscript {
repositories { mavenCentral() }
dependencies {
classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:6.0.0'
classpath 'io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0'
}
}
plugins {
Expand All @@ -12,12 +11,13 @@ plugins {
id 'codenarc'
id 'checkstyle'
id 'maven-publish'
id 'com.bmuschko.nexus' version '2.3.1'
id 'signing'
id 'java-library'
id 'io.github.gradle-nexus.publish-plugin' version '1.0.0'
id 'nebula.optional-base' version '6.0.0'
id 'com.github.kt3k.coveralls' version '2.12.0'
id 'pl.allegro.tech.build.axion-release' version '1.13.3'
}
apply plugin: 'io.codearte.nexus-staging'

scmVersion {
tag { prefix = project.name + '-' }
Expand Down Expand Up @@ -91,53 +91,52 @@ jacocoTestReport {
}
}

nexusStaging {
packageGroup = 'pl.allegro'
numberOfRetries = 15
delayBetweenRetriesInMillis = 5000
test {
useJUnitPlatform()
}

modifyPom {
project {
name 'Spring Boot Starter Handlebars'
description 'Spring Boot auto-configuration for Handlebars template engine'
url 'https://github.com/allegro/handlebars-spring-boot-starter'
inceptionYear '2015'

scm {
url 'https://github.com/allegro/handlebars-spring-boot-starter'
connection 'scm:[email protected]:allegro/handlebars-spring-boot-starter.git'
developerConnection 'scm:[email protected]:allegro/handlebars-spring-boot-starter.git'
}
java {
withSourcesJar()
withJavadocJar()
}

licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
publishing {
publications {
sonatype(MavenPublication) {
from components.java

developers {
developer {
id 'plesiecki'
name 'Paweł Lesiecki'
pom {
name = 'Spring Boot Starter Handlebars'
description = 'Spring Boot auto-configuration for Handlebars template engine'
url = 'https://github.com/allegro/handlebars-spring-boot-starter'
inceptionYear = '2015'
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "plesiecki"
name = "Paweł Lesiecki"
}
}
scm {
connection = "scm:svn:http://subversion.example.com/svn/project/trunk/"
developerConnection = "scm:[email protected]:allegro/handlebars-spring-boot-starter.git"
url = "https://github.com/allegro/handlebars-spring-boot-starter"
}
}
}

project.optionalDeps.each { dep ->
dependencies.find { it.artifactId == dep.name }.optional = true
}
}
}

test {
useJUnitPlatform()
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
nexusPublishing {
repositories {
sonatype {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
}
Expand Down

0 comments on commit feed7de

Please sign in to comment.