Skip to content

Commit a9bb724

Browse files
authored
Merge pull request #10 from giurim/release-gradle
chore: add release specific gradle settings
2 parents 1bfd5cf + 576a6c3 commit a9bb724

File tree

3 files changed

+63
-4
lines changed

3 files changed

+63
-4
lines changed

build.gradle

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
apply plugin: 'java'
1+
plugins {
2+
id 'java'
3+
id 'maven-publish'
4+
id 'signing'
5+
}
6+
7+
group = 'hu.ssh'
8+
version = '0.1.0'
29

310
compileJava.options.encoding = 'UTF-8'
411

@@ -17,10 +24,60 @@ test {
1724
}
1825
}
1926

20-
uploadArchives {
27+
java {
28+
withJavadocJar()
29+
withSourcesJar()
30+
}
31+
32+
publishing {
2133
repositories {
22-
flatDir {
23-
dirs 'repos'
34+
maven {
35+
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
36+
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
37+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
38+
credentials {
39+
username = System.getenv("NEXUS_USER")
40+
password = System.getenv("NEXUS_PASSWORD")
41+
}
2442
}
2543
}
44+
publications {
45+
maven(MavenPublication) {
46+
from components.java
47+
48+
pom {
49+
name = "$groupId:$artifactId"
50+
description = 'A simple console progressbar for Java'
51+
url = 'https://github.com/raszi/java-progressbar'
52+
licenses {
53+
license {
54+
name = 'MIT License'
55+
url = 'https://opensource.org/licenses/MIT'
56+
distribution = 'repo'
57+
}
58+
}
59+
developers {
60+
developer {
61+
id = 'raszi'
62+
name = 'Istvan Karaszi'
63+
64+
url = 'https://github.com/raszi'
65+
}
66+
}
67+
scm {
68+
connection = 'scm:git:git://github.com/raszi/java-progressbar.git'
69+
developerConnection = 'scm:git:ssh://github.com/raszi/java-progressbar.git'
70+
url = 'https://github.com/raszi/java-progressbar'
71+
}
72+
}
73+
}
74+
}
75+
}
76+
77+
signing {
78+
sign publishing.publications.maven
79+
def signingKeyId = findProperty("signingKeyId")
80+
def signingKey = findProperty("signingKey")
81+
def signingPassword = findProperty("signingPassword")
82+
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
2683
}

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.gradle.internal.publish.checksums.insecure=true

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'java-progressbar'

0 commit comments

Comments
 (0)