Skip to content

Commit 223e463

Browse files
committed
fix build gradle for maven central
1 parent 4386ff3 commit 223e463

4 files changed

Lines changed: 64 additions & 58 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
/build/
22
/.gradle/
33
/.idea/
4+
5+
### Secrets ###
6+
gradle.properties

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Object Fill With Random Value
22
## How to use
33
From maven central <br>
4-
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/ru.objectsfill/objects-fill-processor/badge.svg)](https://maven-badges.herokuapp.com/maven-central/ru.objectsfill/objects-fill-processor)
4+
[![Latest Release](https://maven-badges.sml.io/sonatype-central/ru.objectsfill/objects-fill-processor/badge.svg?subject=Latest%20Release&color=blue)](https://central.sonatype.com/artifact/ru.objectsfill/objects-fill-processor)
55
![Build Status](https://github.com/runafterasun/objects-fill-processor/actions/workflows/gradle.yml/badge.svg)
66

77
```xml

build.gradle

Lines changed: 59 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ plugins {
22
id 'signing'
33
id 'maven-publish'
44
id 'java'
5+
id 'org.jreleaser' version '1.23.0'
56
}
67

78
group 'ru.objectsfill'
8-
version '0.1.1'
9+
version '0.1.4'
910

1011
repositories {
1112
mavenLocal()
@@ -18,95 +19,97 @@ dependencies {
1819
implementation 'org.javassist:javassist:3.30.2-GA'
1920

2021

21-
implementation "org.apache.commons:commons-lang3:3.12.0"
22-
testImplementation "org.apache.commons:commons-lang3:3.12.0"
22+
implementation 'org.apache.commons:commons-lang3:3.18.0'
23+
testImplementation 'org.apache.commons:commons-lang3:3.18.0'
2324

2425
}
2526

2627
test {
2728
useJUnitPlatform()
2829
}
2930

31+
java {
32+
toolchain {
33+
languageVersion = JavaLanguageVersion.of(17)
34+
}
35+
withSourcesJar()
36+
withJavadocJar()
37+
}
38+
3039
tasks.register('sourceJar', Jar) {
3140
from sourceSets.main.allJava
3241
archiveClassifier = "sources"
3342
}
3443

35-
tasks.register('javadocJar', Jar) {
36-
dependsOn javadoc
37-
classifier = 'javadoc'
38-
from javadoc.destinationDir
39-
}
40-
//publishing {
41-
// publications {
42-
// mavenJava(MavenPublication) {
43-
// groupId = 'ru.objectsfill'
44-
// artifactId = 'objects-fill-processor'
45-
// version = "0.1.3"
46-
// from components.java
47-
// }
48-
// }
49-
// repositories {
50-
// mavenLocal()
51-
// }
52-
//}
5344

5445
publishing {
5546
publications {
56-
maven(MavenPublication) {publication ->
57-
artifact sourceJar
58-
artifact javadocJar
59-
artifactId = "objects-fill-processor"
60-
groupId = "ru.objectsfill"
61-
version = "0.1.3"
62-
from(components["java"])
63-
pom {
64-
packaging 'jar'
65-
name.set("Objects Fill Processor")
66-
url.set("https://github.com/runafterasun/objects-fill-processor")
67-
description.set("Fill objects with random values")
47+
maven(MavenPublication) {
48+
groupId = 'ru.objectsfill'
49+
artifactId = 'objects-fill-processor'
50+
51+
from components.java
6852

53+
pom {
54+
name = 'objects-fill-processor'
55+
description = 'Objects Fill Processor'
56+
url = 'https://github.com/runafterasun/objects-fill-processor'
57+
inceptionYear = '2026'
6958
licenses {
7059
license {
7160
name.set("The Apache License, Version 2.0")
7261
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
7362
}
7463
}
75-
76-
scm {
77-
connection.set("scm:https://github.com/runafterasun/objects-fill-processor.git")
78-
developerConnection.set("scm:git@github.com:runafterasun/objects-fill-processor.git")
79-
url.set("https://github.com/runafterasun/objects-fill-processor")
80-
}
81-
8264
developers {
8365
developer {
84-
id.set("Stereo")
85-
name.set("Igor Saenko")
86-
email.set("runafterasun@gmail.com")
66+
id = 'Stereo'
67+
name = 'Igor Saenko'
68+
email = 'runafterasun@gmail.com' // укажите email
8769
}
8870
}
71+
scm {
72+
connection = 'scm:https://github.com/runafterasun/objects-fill-processor.git'
73+
developerConnection = 'scm:git@github.com:runafterasun/objects-fill-processor.git'
74+
url = 'https://github.com/runafterasun/java-xlsx'
75+
}
8976
}
9077
}
9178
}
79+
9280
repositories {
9381
maven {
94-
URI releasesUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
95-
URI snapshotsUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
96-
if (version.toString().endsWith("SNAPSHOT")) {
97-
url = snapshotsUrl
98-
} else {
99-
url = releasesUrl
100-
}
101-
credentials {
102-
username = project.properties["ossrhUsername"].toString()
103-
password = project.properties["ossrhPassword"].toString()
104-
}
82+
url = layout.buildDirectory.dir('staging-deploy')
10583
}
10684
}
10785
}
10886

109-
signing {
110-
sign publishing.publications
87+
jreleaser {
88+
signing {
89+
active = 'ALWAYS'
90+
armored = true
91+
mode = 'FILE'
92+
passphrase = findProperty('signing.password') ?: ''
93+
publicKey = findProperty('signing.publicKey') ?: ''
94+
secretKey = findProperty('signing.secretKey') ?: ''
95+
}
96+
release {
97+
github {
98+
skipRelease = true
99+
}
100+
}
101+
deploy {
102+
maven {
103+
mavenCentral {
104+
sonatype {
105+
active = 'ALWAYS'
106+
url = 'https://central.sonatype.com/api/v1/publisher'
107+
username = findProperty('ossrhUsername') ?: ''
108+
password = findProperty('ossrhPassword') ?: ''
109+
stagingRepository('build/staging-deploy')
110+
}
111+
}
112+
}
113+
}
111114
}
112115

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)