|
1 |
| -['java', 'maven-publish', 'signing', 'jacoco'].each { |
2 |
| - apply plugin : it |
| 1 | +plugins { |
| 2 | + id "java-library" |
| 3 | + id "maven-publish" |
| 4 | + id 'signing' |
| 5 | + id 'jacoco' |
| 6 | + id "io.codearte.nexus-staging" version "0.30.0" |
3 | 7 | }
|
4 | 8 |
|
| 9 | + |
5 | 10 | def profile = "snapshot"
|
6 | 11 | if (project.hasProperty('target')) {
|
7 | 12 | profile = "$target"
|
@@ -32,7 +37,7 @@ repositories {
|
32 | 37 | dependencies {
|
33 | 38 | testImplementation(platform("org.junit:junit-bom:5.7.2"))
|
34 | 39 | // https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-bom
|
35 |
| - testImplementation(platform("org.apache.logging.log4j:log4j-bom:2.14.1")) |
| 40 | + implementation(platform("org.apache.logging.log4j:log4j-bom:2.14.1")) |
36 | 41 |
|
37 | 42 | implementation 'com.amazonaws:aws-java-sdk-s3:1.12.27'
|
38 | 43 | implementation 'org.slf4j:jcl-over-slf4j:1.7.29'
|
@@ -64,24 +69,24 @@ dependencies {
|
64 | 69 | runtimeOnly 'org.apache.logging.log4j:log4j-slf4j-impl'
|
65 | 70 | }
|
66 | 71 |
|
| 72 | +nexusStaging { |
| 73 | + username = System.getenv("MAVEN_USERNAME") |
| 74 | + password = System.getenv("MAVEN_PASSWORD") |
| 75 | + packageGroup = 'com.github.poad' |
| 76 | +} |
| 77 | + |
67 | 78 | publishing {
|
68 | 79 | publications {
|
69 | 80 | release(MavenPublication) {
|
70 | 81 | from components.java
|
71 | 82 |
|
72 |
| - project.tasks.withType(Sign) { |
73 |
| - signatures.all { |
74 |
| - def type = it.type |
75 |
| - if (it.file.name.endsWith('.tar.gz.asc')) { // Workaround in case a tar.gz file should published |
76 |
| - type = 'tar.gz.asc' |
77 |
| - } else if (it.type.equals('xml.asc')) { // Set correct extension for signature of pom file |
78 |
| - type = 'pom.asc' |
79 |
| - } |
80 |
| - artifact source: it.file, classifier: it.classifier ?: null, extension: type |
| 83 | + pom { |
| 84 | + signing { |
| 85 | + useGpgCmd() |
| 86 | + sign publishing.publications.release |
| 87 | + sign configurations.archives |
81 | 88 | }
|
82 |
| - } |
83 | 89 |
|
84 |
| - pom { |
85 | 90 | name = "Amazon Web Services S3 Maven Wagon Support"
|
86 | 91 | description = "Standard Maven wagon support for s3:// urls"
|
87 | 92 | url = "https://github.com/poad/aws-maven"
|
@@ -133,6 +138,13 @@ publishing {
|
133 | 138 | }
|
134 | 139 | }
|
135 | 140 |
|
| 141 | + |
| 142 | +javadoc { |
| 143 | + if(JavaVersion.current().isJava9Compatible()) { |
| 144 | + options.addBooleanOption('html5', true) |
| 145 | + } |
| 146 | +} |
| 147 | + |
136 | 148 | test {
|
137 | 149 | useJUnitPlatform {
|
138 | 150 | includeEngines 'junit-jupiter', 'junit-vintage'
|
|
0 commit comments