Skip to content

Commit feed7de

Browse files
committed
maven publication updated
1 parent b518761 commit feed7de

File tree

2 files changed

+42
-55
lines changed

2 files changed

+42
-55
lines changed

.github/workflows/publish.yml

+2-14
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,10 @@ jobs:
2121
java-version: 1.8
2222

2323
- name: Publish to maven central
24-
run: |
25-
./gradlew uploadArchives \
26-
-PnexusUsername=${SONATYPE_USERNAME} \
27-
-PnexusPassword=${SONATYPE_PASSWORD}
24+
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
2825
env:
2926
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
3027
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
3128
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
3229
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
33-
GPG_PRIVATE_KEY_PASSWORD: ${{ secrets.GPG_PRIVATE_KEY_PASSWORD }}
34-
35-
- name: Publish to maven central
36-
run: |
37-
./gradlew closeRepository promoteRepository \
38-
-PnexusUsername=${SONATYPE_USERNAME} \
39-
-PnexusPassword=${SONATYPE_PASSWORD}
40-
env:
41-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
42-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
30+
GPG_PRIVATE_KEY_PASSWORD: ${{ secrets.GPG_PRIVATE_KEY_PASSWORD }}

build.gradle

+40-41
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ buildscript {
22
repositories { mavenCentral() }
33
dependencies {
44
classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:6.0.0'
5-
classpath 'io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0'
65
}
76
}
87
plugins {
@@ -12,12 +11,13 @@ plugins {
1211
id 'codenarc'
1312
id 'checkstyle'
1413
id 'maven-publish'
15-
id 'com.bmuschko.nexus' version '2.3.1'
14+
id 'signing'
15+
id 'java-library'
16+
id 'io.github.gradle-nexus.publish-plugin' version '1.0.0'
1617
id 'nebula.optional-base' version '6.0.0'
1718
id 'com.github.kt3k.coveralls' version '2.12.0'
1819
id 'pl.allegro.tech.build.axion-release' version '1.13.3'
1920
}
20-
apply plugin: 'io.codearte.nexus-staging'
2121

2222
scmVersion {
2323
tag { prefix = project.name + '-' }
@@ -91,53 +91,52 @@ jacocoTestReport {
9191
}
9292
}
9393

94-
nexusStaging {
95-
packageGroup = 'pl.allegro'
96-
numberOfRetries = 15
97-
delayBetweenRetriesInMillis = 5000
94+
test {
95+
useJUnitPlatform()
9896
}
9997

100-
modifyPom {
101-
project {
102-
name 'Spring Boot Starter Handlebars'
103-
description 'Spring Boot auto-configuration for Handlebars template engine'
104-
url 'https://github.com/allegro/handlebars-spring-boot-starter'
105-
inceptionYear '2015'
106-
107-
scm {
108-
url 'https://github.com/allegro/handlebars-spring-boot-starter'
109-
connection 'scm:[email protected]:allegro/handlebars-spring-boot-starter.git'
110-
developerConnection 'scm:[email protected]:allegro/handlebars-spring-boot-starter.git'
111-
}
98+
java {
99+
withSourcesJar()
100+
withJavadocJar()
101+
}
112102

113-
licenses {
114-
license {
115-
name 'The Apache Software License, Version 2.0'
116-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
117-
}
118-
}
103+
publishing {
104+
publications {
105+
sonatype(MavenPublication) {
106+
from components.java
119107

120-
developers {
121-
developer {
122-
id 'plesiecki'
123-
name 'Paweł Lesiecki'
108+
pom {
109+
name = 'Spring Boot Starter Handlebars'
110+
description = 'Spring Boot auto-configuration for Handlebars template engine'
111+
url = 'https://github.com/allegro/handlebars-spring-boot-starter'
112+
inceptionYear = '2015'
113+
licenses {
114+
license {
115+
name = "The Apache License, Version 2.0"
116+
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
117+
}
118+
}
119+
developers {
120+
developer {
121+
id = "plesiecki"
122+
name = "Paweł Lesiecki"
123+
}
124+
}
125+
scm {
126+
connection = "scm:svn:http://subversion.example.com/svn/project/trunk/"
127+
developerConnection = "scm:[email protected]:allegro/handlebars-spring-boot-starter.git"
128+
url = "https://github.com/allegro/handlebars-spring-boot-starter"
129+
}
124130
}
125131
}
126-
127-
project.optionalDeps.each { dep ->
128-
dependencies.find { it.artifactId == dep.name }.optional = true
129-
}
130132
}
131133
}
132134

133-
test {
134-
useJUnitPlatform()
135-
}
136-
137-
publishing {
138-
publications {
139-
mavenJava(MavenPublication) {
140-
from components.java
135+
nexusPublishing {
136+
repositories {
137+
sonatype {
138+
username = System.getenv("SONATYPE_USERNAME")
139+
password = System.getenv("SONATYPE_PASSWORD")
141140
}
142141
}
143142
}

0 commit comments

Comments
 (0)