Skip to content
This repository was archived by the owner on Mar 16, 2025. It is now read-only.

Commit 7b674d2

Browse files
committed
simpler publishing
1 parent 2ba22f9 commit 7b674d2

File tree

3 files changed

+56
-67
lines changed

3 files changed

+56
-67
lines changed

build.gradle

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ plugins {
33
id 'groovy'
44
id 'java-library'
55
id 'maven-publish'
6-
id 'com.jfrog.bintray' version '1.8.5'
7-
id 'com.jfrog.artifactory' version '4.15.2'
86
id 'org.jetbrains.dokka' version '0.10.1'
97
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
108
id 'org.unbroken-dome.test-sets' version '3.0.1'
@@ -35,8 +33,25 @@ repositories {
3533
maven {
3634
url "https://oss.sonatype.org/content/repositories/snapshots"
3735
}
36+
3837
maven {
3938
url "https://dl.bintray.com/openapi-processor/primary"
39+
content {
40+
includeGroup "io.openapiprocessor"
41+
}
42+
mavenContent {
43+
releasesOnly()
44+
}
45+
}
46+
47+
maven {
48+
url "https://oss.jfrog.org/artifactory/oss-snapshot-local"
49+
content {
50+
includeGroup "io.openapiprocessor"
51+
}
52+
mavenContent {
53+
snapshotsOnly()
54+
}
4055
}
4156
}
4257

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-core
9+
10+
systemProp.org.gradle.internal.publish.checksums.insecure=true

gradle/publishing.gradle

Lines changed: 37 additions & 65 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.projectTitle} - ${project.projectDesc} - ${project.name} module".toString()
15+
url = project.projectUrl
16+
17+
licenses {
18+
license {
19+
name = 'The Apache Software License, Version 2.0'
20+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
21+
distribution = "repo"
22+
}
23+
}
24+
25+
developers {
26+
developer {
27+
id = 'hauner'
28+
name = 'Martin Hauner'
29+
}
30+
}
31+
32+
scm {
33+
url = "https://github.com/${project.projectGithubRepo}".toString ()
34+
}
35+
}
4336

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
5637
}
5738
}
58-
resolve {
59-
repoKey = 'jcenter'
60-
}
61-
}
6239

40+
repositories {
6341

64-
bintray {
65-
user = bintrayUser
66-
key = bintrayKey
67-
publications = ['projectArtifacts']
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)