Skip to content

Commit faa38f8

Browse files
fix: release publishing (#174)
1 parent 21613cd commit faa38f8

1 file changed

Lines changed: 60 additions & 75 deletions

File tree

build.gradle

Lines changed: 60 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,9 @@ dependencies {
3030
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
3131
}
3232

33-
task javadocJar(type: Jar) {
34-
classifier = 'javadoc'
35-
from javadoc
36-
}
37-
38-
task sourcesJar(type: Jar) {
39-
classifier = 'sources'
40-
from sourceSets.main.allSource
41-
}
42-
43-
artifacts {
44-
archives javadocJar, sourcesJar
45-
}
46-
47-
if (project.hasProperty("signing.keyId")) {
48-
apply plugin: 'signing'
49-
signing {
50-
sign configurations.archives
51-
}
33+
java {
34+
withJavadocJar()
35+
withSourcesJar()
5236
}
5337

5438
test {
@@ -96,78 +80,79 @@ wrapper {
9680
gradleVersion = '7.2'
9781
}
9882

99-
task writeNewPom {
100-
doLast {
101-
pom {
102-
groupId = project.group
103-
version = project.version
104-
artifactId = 'crypto'
105-
106-
name = 'java-crypto'
107-
description = 'A Simple Cryptography Implementation in Java for the ARK CORE Blockchain Framework.'
108-
url = 'https://sdk.ark.dev/java/crypto'
109-
inceptionYear = '2018'
110-
111-
licenses {
112-
license {
113-
name = 'MIT'
114-
distribution = 'repo'
83+
publishing {
84+
publications {
85+
mavenJava(MavenPublication) {
86+
from components.java
87+
pom {
88+
groupId = project.group
89+
version = project.version
90+
artifactId = 'crypto'
91+
92+
name = 'java-crypto'
93+
description = 'A Simple Cryptography Implementation in Java for the ARK CORE Blockchain Framework.'
94+
url = 'https://sdk.ark.dev/java/crypto'
95+
inceptionYear = '2018'
96+
97+
licenses {
98+
license {
99+
name = 'MIT'
100+
distribution = 'repo'
101+
}
115102
}
116-
}
117103

118-
developers {
119-
developer {
120-
name = 'Kovač Žan'
121-
email = 'zan@ark.io'
122-
organization = 'ARK Ecosystem'
123-
organizationUrl = 'https://ark.io'
124-
}
125-
developer {
126-
name = 'Kristjan Košič'
127-
email = 'kristjan@ark.io'
128-
organization = 'ARK Ecosystem'
129-
organizationUrl = 'https://ark.io'
130-
}
131-
developer {
132-
name = 'Brian Faust'
133-
email = 'brian@ark.io'
134-
organization = 'ARK Ecosystem'
135-
organizationUrl = 'https://ark.io'
104+
developers {
105+
developer {
106+
name = 'Kovač Žan'
107+
email = 'zan@ark.io'
108+
organization = 'ARK Ecosystem'
109+
organizationUrl = 'https://ark.io'
110+
}
111+
developer {
112+
name = 'Kristjan Košič'
113+
email = 'kristjan@ark.io'
114+
organization = 'ARK Ecosystem'
115+
organizationUrl = 'https://ark.io'
116+
}
117+
developer {
118+
name = 'Brian Faust'
119+
email = 'brian@ark.io'
120+
organization = 'ARK Ecosystem'
121+
organizationUrl = 'https://ark.io'
122+
}
123+
developer {
124+
name = 'Joshua Noack'
125+
email = 'joshua@ark.io'
126+
organization = 'ARK Ecosystem'
127+
organizationUrl = 'https://ark.io'
128+
}
136129
}
137-
developer {
138-
name = 'Joshua Noack'
139-
email = 'joshua@ark.io'
140-
organization = 'ARK Ecosystem'
141-
organizationUrl = 'https://ark.io'
142-
}
143-
}
144130

145-
scm {
146-
connection = 'scm:git:git://github.com/ArkEcosystem/java-crypto.git'
147-
developerConnection = 'scm:git:ssh://github.com:ArkEcosystem/java-crypto.git'
148-
url = 'https://github.com/ArkEcosystem/java-crypto'
131+
scm {
132+
connection = 'scm:git:git://github.com/ArkEcosystem/java-crypto.git'
133+
developerConnection = 'scm:git:ssh://github.com:ArkEcosystem/java-crypto.git'
134+
url = 'https://github.com/ArkEcosystem/java-crypto'
135+
}
149136
}
150-
}.writeTo("$buildDir/newpom.xml")
151-
}
152-
}
153-
154-
publishing {
155-
156-
publications {
157-
myLibrary(MavenPublication) {
158-
from components.java
159137
}
160138
}
161139

162140
repositories {
163141
mavenLocal()
164142
maven {
165143
name = "OSSRH"
166-
url = "https://oss.sonatype.org/content/groups/public/"
144+
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
167145
credentials {
168146
username = System.getenv("MAVEN_USERNAME")
169147
password = System.getenv("MAVEN_PASSWORD")
170148
}
171149
}
172150
}
173151
}
152+
153+
if (project.hasProperty("signing.keyId")) {
154+
apply plugin: 'signing'
155+
signing {
156+
sign publishing.publications.mavenJava
157+
}
158+
}

0 commit comments

Comments
 (0)