Skip to content

Commit d9fef85

Browse files
committed
simpler publishing
1 parent 932aefe commit d9fef85

File tree

3 files changed

+40
-68
lines changed

3 files changed

+40
-68
lines changed

build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ plugins {
22
id 'java'
33
id 'java-library'
44
id 'maven-publish'
5-
id 'com.jfrog.bintray' version '1.8.5'
6-
id 'com.jfrog.artifactory' version '4.15.2'
75
id "com.github.ben-manes.versions" version "0.28.0"
86
}
97

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ projectTitle=openapi-processor
66
projectDesc=converts OpenAPI yaml descriptions to a target format, e.g. Java code (Spring) or json
77

88
projectGithubRepo=openapi-processor/openapi-processor-api
9+
10+
systemProp.org.gradle.internal.publish.checksums.insecure=true

gradle/publishing.gradle

Lines changed: 38 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,53 @@
1-
def pomConfig = {
2-
licenses {
3-
license {
4-
name 'The Apache Software License, Version 2.0'
5-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
6-
distribution "repo"
7-
}
8-
}
9-
developers {
10-
developer {
11-
id 'hauner'
12-
name 'Martin Hauner'
13-
}
14-
}
15-
16-
scm {
17-
url "https://github.com/${project.projectGithubRepo}".toString ()
18-
}
19-
}
20-
211
publishing {
222
publications {
23-
projectArtifacts (MavenPublication) {
24-
from components.java
25-
artifact sourcesJar
26-
artifact javadocJar
27-
3+
OpenApiProcessor (MavenPublication) {
284
groupId project.group
295
artifactId project.name
306
version project.version
317

32-
pom.withXml {
33-
def root = asNode()
34-
root.appendNode('name', project.projectTitle)
35-
root.appendNode('description', project.projectDesc)
36-
root.appendNode('url', project.projectUrl)
37-
root.children().last() + pomConfig
38-
}
39-
}
40-
}
41-
}
8+
from components.java
9+
artifact sourcesJar
10+
artifact javadocJar
4211

12+
pom {
13+
name = project.projectTitle
14+
// description = project.projectDesc
15+
description = "${project.projectTitle} - ${project.projectDesc} - ${project.name} module".toString()
16+
url = project.projectUrl
17+
18+
licenses {
19+
license {
20+
name = 'The Apache Software License, Version 2.0'
21+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
22+
distribution = "repo"
23+
}
24+
}
25+
26+
developers {
27+
developer {
28+
id = 'hauner'
29+
name = 'Martin Hauner'
30+
}
31+
}
32+
33+
scm {
34+
url = "https://github.com/${project.projectGithubRepo}".toString ()
35+
}
36+
}
4337

44-
artifactory {
45-
contextUrl = 'https://oss.jfrog.org'
46-
publish {
47-
repository {
48-
repoKey = 'oss-snapshot-local'
49-
username = bintrayUser
50-
password = bintrayKey
51-
}
52-
defaults {
53-
publications('projectArtifacts')
54-
publishArtifacts = true
55-
publishPom = true
5638
}
5739
}
58-
resolve {
59-
repoKey = 'jcenter'
60-
}
61-
}
62-
6340

64-
bintray {
65-
user = bintrayUser
66-
key = bintrayKey
67-
publications = ['projectArtifacts']
41+
repositories {
42+
maven {
43+
def releaseRepository = uri("https://api.bintray.com/maven/openapi-processor/primary/${project.name}/;publish=1;override=0")
44+
def snapshotRepository = uri("https://oss.jfrog.org/oss-snapshot-local/")
45+
url = version.endsWith('SNAPSHOT') ? snapshotRepository : releaseRepository
6846

69-
pkg {
70-
repo = 'primary'
71-
name = project.name
72-
userOrg = 'openapi-processor'
73-
licenses = ['Apache-2.0']
74-
vcsUrl = "https://github.com/${project.projectGithubRepo}".toString ()
75-
websiteUrl = projectUrl
76-
desc = "${project.projectTitle} - ${project.projectDesc} - ${project.name} module".toString()
77-
version {
78-
name = project.version
47+
credentials {
48+
username = bintrayUser
49+
password = bintrayKey
50+
}
7951
}
8052
}
8153
}

0 commit comments

Comments
 (0)