Skip to content

Commit bc85d30

Browse files
authored
Merge pull request #6 from xenit-eu/ACC-1443
[ACC-1443] Prepare for publication to maven central
2 parents 42b21bc + 1d50032 commit bc85d30

File tree

4 files changed

+80
-1
lines changed

4 files changed

+80
-1
lines changed

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ plugins {
55
id 'org.sonarqube'
66
}
77

8+
apply from: "${rootDir}/gradle/publish.gradle"
9+
810
java {
911
toolchain {
1012
languageVersion = JavaLanguageVersion.of(17)
1113
}
14+
withSourcesJar()
15+
withJavadocJar()
1216
}
1317

1418
jacocoTestReport {

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
group=com.contentgrid.hal.client
2+
description=HAL and HAL-FORMS client

gradle/publish.gradle

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
apply plugin: 'maven-publish'
2+
apply plugin: 'signing'
3+
4+
publishing {
5+
publications {
6+
7+
all {
8+
pom {
9+
url = 'https://github.com/xenit-eu/java-hal-client'
10+
name = project.name
11+
description = project.description
12+
13+
scm {
14+
connection = 'scm:git:[email protected]:xenit-eu/java-hal-client.git'
15+
developerConnection = 'scm:git:[email protected]:xenit-eu/java-hal-client.git'
16+
url = 'https://github.com/xenit-eu/java-hal-client.git'
17+
}
18+
19+
developers {
20+
developer {
21+
name = "XeniT"
22+
organization = "XeniT Solutions NV"
23+
}
24+
}
25+
26+
licenses {
27+
license {
28+
name = 'The Apache License, Version 2.0'
29+
url = 'https://www.apache.org/licenses/LICENSE-2.0'
30+
}
31+
}
32+
}
33+
}
34+
35+
library(MavenPublication) {
36+
from components.java
37+
38+
versionMapping {
39+
usage("java-api") {
40+
fromResolutionResult()
41+
}
42+
usage("java-runtime") {
43+
fromResolutionResult()
44+
}
45+
}
46+
}
47+
}
48+
49+
repositories {
50+
if ("${project.version}".endsWith('-SNAPSHOT')) {
51+
sonatypeSnapshots {
52+
url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
53+
credentials {
54+
username = project.findProperty('sonatype_username')
55+
password = project.findProperty('sonatype_password')
56+
}
57+
}
58+
} else {
59+
sonatypeMavenCentral {
60+
url = "https://s01.oss.sonatype.org/service/local/"
61+
credentials {
62+
username = project.findProperty('sonatype_username')
63+
password = project.findProperty('sonatype_password')
64+
}
65+
}
66+
}
67+
}
68+
69+
}
70+
71+
tasks.named('check').configure {
72+
dependsOn('checkMavenCentralRequirements')
73+
}

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ reckon {
2323
stageCalc = { inventory, targetNormal -> java.util.Optional.empty() }
2424
}
2525

26-
rootProject.name = 'java-hal-client'
26+
rootProject.name = 'hal-client'

0 commit comments

Comments
 (0)