Skip to content

Commit d78cb1f

Browse files
committed
publish to Maven Central
1 parent d3bf075 commit d78cb1f

File tree

2 files changed

+34
-52
lines changed

2 files changed

+34
-52
lines changed

build.gradle

Lines changed: 33 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ plugins {
55
id 'maven-publish'
66
id 'signing'
77
id 'idea'
8-
// id 'checkstyle'
98
id 'com.github.johnrengelman.shadow' version '7.1.2'
9+
id 'com.vanniktech.maven.publish' version '0.35.0'
1010
}
1111

1212
group = "com.github.tsantalis"
1313
version = project.hasProperty('buildVersion') ?
1414
project.buildVersion
15-
: '3.0.11'
15+
: '3.0.12'
1616

1717
applicationName = rootProject.name
1818
mainClassName = "org.refactoringminer.RefactoringMiner"
@@ -24,14 +24,6 @@ idea {
2424
}
2525
}
2626

27-
//checkstyle {
28-
// toolVersion = '8.36'
29-
// configFile = rootProject.file('config/checkstyle/checkstyle.xml')
30-
// configProperties = [suppressionFile: "${rootProject.file('config/checkstyle/checkstyle_supressions.xml')}"]
31-
// ignoreFailures = false
32-
// showViolations = true
33-
//}
34-
3527
repositories {
3628
mavenCentral()
3729
}
@@ -116,51 +108,41 @@ artifacts {
116108

117109
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
118110

119-
publishing {
120-
repositories {
121-
maven {
122-
def releaseRepo = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
123-
def snapshotRepo = "https://oss.sonatype.org/content/repositories/snapshots/"
124-
url = isReleaseVersion ? releaseRepo : snapshotRepo
125-
credentials {
126-
username = project.hasProperty('ossrhUsername') ? ossrhUsername : "Unknown user"
127-
password = project.hasProperty('ossrhPassword') ? ossrhPassword : "Unknown password"
128-
}
129-
}
130-
}
111+
mavenPublishing {
112+
publishToMavenCentral()
131113

132-
publications {
133-
mavenJava(MavenPublication) {
134-
artifactId = 'refactoring-miner'
135-
from components.java
136-
137-
pom {
138-
name = "Refactoring Miner"
139-
description = 'RefactoringMiner is a library/API written in Java that can detect refactorings applied in the history of a Java project.'
140-
url = 'https://github.com/tsantalis/RefactoringMiner'
141-
licenses {
142-
license {
143-
name = 'The MIT License (MIT)'
144-
url = 'http://opensource.org/licenses/MIT'
145-
}
146-
}
147-
developers {
148-
developer {
149-
id = 'tsantalis'
150-
name = 'Nikolaos Tsantalis'
151-
152-
}
153-
}
154-
scm {
155-
connection = 'scm:git:[email protected]:tsantalis/RefactoringMiner.git'
156-
developerConnection = 'scm:git:[email protected]:tsantalis/RefactoringMiner.git'
157-
url = 'https://github.com/tsantalis/RefactoringMiner/tree/master'
158-
}
159-
}
160-
}
114+
signAllPublications()
115+
}
116+
117+
mavenPublishing {
118+
coordinates("com.github.tsantalis", "refactoring-miner", "3.0.12")
119+
120+
pom {
121+
name = "Refactoring Miner"
122+
description = 'RefactoringMiner is a library/API written in Java that can detect refactorings applied in the history of a Java project.'
123+
url = 'https://github.com/tsantalis/RefactoringMiner'
124+
licenses {
125+
license {
126+
name = 'The MIT License (MIT)'
127+
url = 'http://opensource.org/licenses/MIT'
128+
}
129+
}
130+
developers {
131+
developer {
132+
id = 'tsantalis'
133+
name = 'Nikolaos Tsantalis'
134+
135+
}
161136
}
137+
scm {
138+
connection = 'scm:git:[email protected]:tsantalis/RefactoringMiner.git'
139+
developerConnection = 'scm:git:[email protected]:tsantalis/RefactoringMiner.git'
140+
url = 'https://github.com/tsantalis/RefactoringMiner/tree/master'
141+
}
142+
}
162143
}
163144

145+
164146
signing {
165147
sign publishing.publications.mavenJava
166148
}
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.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)