Skip to content

Commit bed43ed

Browse files
committed
Fixed bintray usage. Plugin-ID for bintray does not work within script (see #1262).
Removed model space to allow local publishing of releases.
1 parent 938d470 commit bed43ed

File tree

1 file changed

+51
-43
lines changed

1 file changed

+51
-43
lines changed

‎_ext/gradle/java-publish.gradle‎

Lines changed: 51 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
buildscript {
2+
repositories {
3+
jcenter()
4+
}
5+
dependencies {
6+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
7+
}
8+
}
9+
10+
apply plugin: com.jfrog.bintray.gradle.BintrayPlugin
111
apply plugin: 'maven-publish'
212

313
task sourcesJar(type: Jar) {
@@ -22,60 +32,58 @@ def lookup = { key, defaultVal ->
2232
}
2333
}
2434

25-
model {
26-
publishing {
27-
publications {
28-
mavenJava(MavenPublication) {
35+
publishing {
36+
publications {
37+
mavenJava(MavenPublication) {
2938

30-
groupId project.ext_group
31-
artifactId project.ext_artifactId
32-
version project.ext_version
33-
from components.java
39+
groupId project.ext_group
40+
artifactId project.ext_artifactId
41+
version project.ext_version
42+
from components.java
3443

35-
pom.withXml {
44+
pom.withXml {
3645

37-
// add MavenCentral requirements to the POM
38-
asNode().children().last() + {
39-
resolveStrategy = Closure.DELEGATE_FIRST
40-
name project.ext_artifactId
41-
description project.ext_description
46+
// add MavenCentral requirements to the POM
47+
asNode().children().last() + {
48+
resolveStrategy = Closure.DELEGATE_FIRST
49+
name project.ext_artifactId
50+
description project.ext_description
51+
url "https://github.com/${project.ext_org}/${project.name}"
52+
scm {
4253
url "https://github.com/${project.ext_org}/${project.name}"
43-
scm {
44-
url "https://github.com/${project.ext_org}/${project.name}"
45-
connection "scm:git:git://github.com/${project.ext_org}/${project.name}"
46-
developerConnection "scm:git:ssh:git@github.com/${project.ext_org}/${project.name}"
47-
}
48-
licenses {
49-
license {
50-
name 'Eclipse Public License - v 1.0'
51-
url 'https://www.eclipse.org/legal/epl-v10.html'
52-
distribution 'repo'
53-
}
54+
connection "scm:git:git://github.com/${project.ext_org}/${project.name}"
55+
developerConnection "scm:git:ssh:git@github.com/${project.ext_org}/${project.name}"
56+
}
57+
licenses {
58+
license {
59+
name 'Eclipse Public License - v 1.0'
60+
url 'https://www.eclipse.org/legal/epl-v10.html'
61+
distribution 'repo'
5462
}
55-
developers {
56-
project.ext.developers.each { extId, extValues ->
57-
developer {
58-
id extId
59-
name extValues['name']
60-
email extValues['email']
61-
}
63+
}
64+
developers {
65+
project.ext.developers.each { extId, extValues ->
66+
developer {
67+
id extId
68+
name extValues['name']
69+
email extValues['email']
6270
}
6371
}
6472
}
6573
}
6674
}
6775
}
68-
if (isSnapshot) {
69-
// upload snapshots to oss.sonatype.org
70-
repositories {
71-
maven {
72-
url = lookup('snapshot_url', 'https://oss.sonatype.org/content/repositories/snapshots')
73-
credentials {
74-
username = lookup('nexus_user', 'unknown_nexus_user')
75-
password = lookup('nexus_pass', 'unknown_nexus_pass')
76-
}
77-
} }
78-
}
76+
}
77+
if (isSnapshot) {
78+
// upload snapshots to oss.sonatype.org
79+
repositories {
80+
maven {
81+
url = lookup('snapshot_url', 'https://oss.sonatype.org/content/repositories/snapshots')
82+
credentials {
83+
username = lookup('nexus_user', 'unknown_nexus_user')
84+
password = lookup('nexus_pass', 'unknown_nexus_pass')
85+
}
86+
} }
7987
}
8088
}
8189

0 commit comments

Comments
 (0)