Skip to content

Commit 07a3aec

Browse files
committed
updated publishing to central
1 parent 017bd2e commit 07a3aec

File tree

2 files changed

+58
-2
lines changed

2 files changed

+58
-2
lines changed

build.gradle

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
plugins {
22
id 'java'
33
id 'maven-publish'
4+
id 'signing'
45
}
56

67
group = GROUP
78
version = VERSION
89

10+
def isReleaseBuild() {
11+
return version.contains("SNAPSHOT") == false
12+
}
13+
914
sourceCompatibility = 1.8
1015

1116
repositories {
@@ -29,11 +34,59 @@ task createJavadoc(type: Jar, dependsOn: 'javadoc') {
2934

3035
publishing {
3136
publications {
32-
mavenJavabeans(MavenPublication) {
37+
mavenJava(MavenPublication) {
3338
from components.java
3439

3540
artifact createJavadoc
3641
artifact createSources
42+
43+
pom {
44+
name = 'jmath'
45+
description = 'Beans for Java'
46+
url = 'https://github.com/tomtzook/JavaBeans'
47+
48+
licenses {
49+
license {
50+
name = 'Apache License 2.0'
51+
url = ' http://www.apache.org/licenses/LICENSE-2.0'
52+
}
53+
}
54+
55+
developers {
56+
developer {
57+
id = 'tomtzook'
58+
name = 'Tom Tzook'
59+
60+
}
61+
}
62+
63+
scm {
64+
connection = 'scm:git:git://github.com/tomtzook/JavaBeans.git'
65+
developerConnection = 'scm:git:ssh://github.com/tomtzook/JavaBeans.git'
66+
url = 'https://github.com/tomtzook/JavaBeans'
67+
}
68+
}
3769
}
3870
}
71+
72+
repositories {
73+
maven {
74+
if (isReleaseBuild()) {
75+
name = 'NexusStaging'
76+
url = NEXUS_RELEASE_REPOSITORY_URL
77+
} else {
78+
name = 'NexusSnapshot'
79+
url = NEXUS_SNAPSHOT_REPOSITORY_URL
80+
}
81+
82+
credentials {
83+
username ''
84+
password ''
85+
}
86+
}
87+
}
88+
}
89+
90+
signing {
91+
sign publishing.publications.mavenJava
3992
}

gradle.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
GROUP = com.flash3388.util
2-
VERSION = 1.0
2+
VERSION = 1.0
3+
4+
NEXUS_SNAPSHOT_REPOSITORY_URL=https\://oss.sonatype.org/content/repositories/snapshots
5+
NEXUS_RELEASE_REPOSITORY_URL=https\://oss.sonatype.org/service/local/staging/deploy/maven2

0 commit comments

Comments
 (0)