11buildscript {
22 repositories {
33 mavenCentral()
4+ maven {
5+ url ' https://plugins.gradle.org/m2/'
6+ }
7+ }
8+ dependencies {
9+ classpath(' com.github.ben-manes:gradle-versions-plugin:0.29.0' )
410 }
511}
612
@@ -9,11 +15,14 @@ subprojects {
915 mavenCentral()
1016 }
1117
12- apply plugin : ' java'
18+ apply plugin : ' java-library '
1319
1420 java {
1521 sourceCompatibility = JavaVersion . VERSION_11
1622 targetCompatibility = JavaVersion . VERSION_11
23+
24+ withJavadocJar()
25+ withSourcesJar()
1726 }
1827
1928 compileJava. dependsOn(processResources)
@@ -26,81 +35,77 @@ subprojects {
2635 options. encoding = " UTF-8"
2736 }
2837
29- apply plugin : ' maven'
30-
31- apply plugin : ' signing'
32-
33- signing {
34- sign configurations. archives
35- }
36-
3738 apply plugin : ' maven-publish'
38- uploadArchives {
39- repositories {
40- mavenDeployer {
41- beforeDeployment { MavenDeployment deployment -> signing . signPom(deployment) }
42-
43- repository( url : " https://oss.sonatype.org/service/local/staging/deploy/maven2/ " ) {
44- authentication( userName : ossrhUsername, password : ossrhPassword )
45- }
46-
47- snapshotRepository( url : " https://oss.sonatype.org/content/repositories/snapshots/ " ) {
48- authentication( userName : ossrhUsername, password : ossrhPassword)
39+ publishing {
40+ publications {
41+ mavenJava( MavenPublication ) {
42+ from components . java
43+ versionMapping {
44+ usage( ' java-api ' ) {
45+ fromResolutionOf( ' runtimeClasspath ' )
46+ }
47+ usage( ' java-runtime ' ) {
48+ fromResolutionResult()
49+ }
4950 }
50-
51- pom. project {
52- inceptionYear ' 2019'
53- name project. name
54- packaging ' jar'
55- description project. description
56-
57- url ' https://github.com/bottomless-archive-project/java-warc.git'
51+ pom {
52+ inceptionYear = ' 2019'
53+ name = project. name
54+ packaging = ' jar'
55+ description = project. description
56+ url = ' https://github.com/bottomless-archive-project/java-warc.git'
5857
5958 scm {
60- connection ' git@github.com:bottomless-archive-project/java-warc.git'
61- developerConnection ' git@github.com:bottomless-archive-project/java-warc.git'
62- url ' https://github.com/bottomless-archive-project/java-warc.git'
59+ connection = ' git@github.com:bottomless-archive-project/java-warc.git'
60+ developerConnection = ' git@github.com:bottomless-archive-project/java-warc.git'
61+ url = ' https://github.com/bottomless-archive-project/java-warc.git'
6362 }
6463
6564 licenses {
6665 license {
67- name ' Apache License 2.0'
68- url ' https://opensource.org/licenses/Apache-2.0'
66+ name = ' Apache License 2.0'
67+ url = ' https://opensource.org/licenses/Apache-2.0'
6968 }
7069 }
7170
7271 developers {
7372 developer {
74- id ' gyulalakatos'
75- name ' Gyula Lakatos'
76- email ' laxika91@gmail.com'
73+ id = ' gyulalakatos'
74+ name = ' Gyula Lakatos'
75+ email = ' laxika91@gmail.com'
7776 }
7877 }
7978 }
8079 }
8180 }
81+ repositories {
82+ maven {
83+ // change URLs to point to your repos, e.g. http://my.org/repo
84+ def releasesRepoUrl = layout. buildDirectory. dir(' repos/releases' )
85+ def snapshotsRepoUrl = layout. buildDirectory. dir(' repos/snapshots' )
86+ url = version. endsWith(' SNAPSHOT' ) ? snapshotsRepoUrl : releasesRepoUrl
87+ }
88+ }
8289 }
8390
84- task sourcesJar(type : Jar ) {
85- from sourceSets. main. allJava
86- classifier ' sources'
87- }
91+ apply plugin : ' signing'
8892
89- task javadocJar(type : Jar ) {
90- from javadoc
91- classifier ' javadoc'
93+ signing {
94+ sign publishing. publications. mavenJava
9295 }
9396
9497 artifacts {
9598 archives javadocJar, sourcesJar
9699 }
97100
98101 dependencies {
99- compileOnly group : ' org.projectlombok' , name : ' lombok' , version : ' 1.18.16 '
100- annotationProcessor group : ' org.projectlombok' , name : ' lombok' , version : ' 1.18.16 '
101- testCompileOnly group : ' org.projectlombok' , name : ' lombok' , version : ' 1.18.16 '
102- testAnnotationProcessor group : ' org.projectlombok' , name : ' lombok' , version : ' 1.18.16 '
102+ compileOnly group : ' org.projectlombok' , name : ' lombok' , version : ' 1.18.20 '
103+ annotationProcessor group : ' org.projectlombok' , name : ' lombok' , version : ' 1.18.20 '
104+ testCompileOnly group : ' org.projectlombok' , name : ' lombok' , version : ' 1.18.20 '
105+ testAnnotationProcessor group : ' org.projectlombok' , name : ' lombok' , version : ' 1.18.20 '
103106
104- testCompile group : ' org.slf4j' , name : ' slf4j-simple' , version : ' 1.7.30 '
107+ testImplementation group : ' org.slf4j' , name : ' slf4j-simple' , version : ' 1.7.32 '
105108 }
109+
110+ apply plugin : ' com.github.ben-manes.versions'
106111}
0 commit comments