|
1 | 1 | subprojects { |
2 | | - apply plugin: 'maven-publish' |
| 2 | + apply plugin: "com.vanniktech.maven.publish" |
3 | 3 |
|
4 | | - jar { |
5 | | - from sourceSets.main.allSource |
| 4 | + ext { |
| 5 | + groupId = 'com.codeborne.assertlog' |
| 6 | + } |
6 | 7 |
|
| 8 | + tasks.withType(Jar).configureEach { |
7 | 9 | manifest { |
8 | 10 | attributes( |
9 | | - "Automatic-Module-Name": project.group + '.' + project.name, |
10 | | - "Implementation-Title": project.group + '.' + project.name, |
| 11 | + "Automatic-Module-Name": project.groupId + '.' + project.name, |
| 12 | + "Implementation-Title": project.groupId + '.' + project.name, |
11 | 13 | "Implementation-Version": archiveVersion, |
12 | 14 | "Implementation-Vendor": "Andrei Solntsev & Codeborne") |
13 | 15 | } |
14 | 16 | } |
15 | 17 |
|
16 | | - java { |
17 | | - withSourcesJar() |
18 | | - withJavadocJar() |
19 | | - } |
20 | | - |
21 | | - publishing { |
22 | | - publications { |
23 | | - mavenJava(MavenPublication) { |
24 | | - from components.java |
25 | | - |
26 | | - pom { |
27 | | - name = project.name |
28 | | - packaging = 'jar' |
29 | | - description = 'AssertLog: Unit-tests for your logging' |
30 | | - url = 'https://github.com/java-testkit/assertlog' |
31 | | - |
32 | | - scm { |
33 | | - url = 'scm:git@github.com:java-testkit/assertlog.git' |
34 | | - connection = 'scm:git@github.com:java-testkit/assertlog.git' |
35 | | - developerConnection = 'scm:git@github.com:java-testkit/assertlog.git' |
36 | | - } |
37 | | - |
38 | | - licenses { |
39 | | - license { |
40 | | - name = 'MIT' |
41 | | - url = 'https://opensource.org/licenses/MIT' |
42 | | - distribution = 'repo' |
43 | | - } |
44 | | - } |
| 18 | + mavenPublishing { |
| 19 | + if (project.hasProperty("signing.keyId")) { |
| 20 | + publishToMavenCentral(true) |
| 21 | + signAllPublications() |
| 22 | + } |
45 | 23 |
|
46 | | - developers { |
47 | | - developer { |
48 | | - id = 'asolntsev' |
49 | | - name = 'Andrei Solntsev' |
50 | | - } |
51 | | - } |
| 24 | + coordinates(project.groupId, project.name, project.version) |
| 25 | + pom { |
| 26 | + name = project.name |
| 27 | + description = 'AssertLog: Unit-tests for your logging' |
| 28 | + url = 'https://github.com/java-testkit/assertlog' |
| 29 | + inceptionYear = '2019' |
| 30 | + licenses { |
| 31 | + license { |
| 32 | + name = 'MIT' |
| 33 | + url = 'https://opensource.org/licenses/MIT' |
52 | 34 | } |
53 | 35 | } |
54 | | - } |
55 | | - |
56 | | - repositories { |
57 | | - maven { |
58 | | - url = version.endsWith('-SNAPSHOT') ? |
59 | | - 'https://oss.sonatype.org/content/repositories/snapshots/' : |
60 | | - 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' |
61 | | - |
62 | | - credentials { |
63 | | - username = findProperty('sonatypeUsername') ?: '' |
64 | | - password = findProperty('sonatypePassword') ?: '' |
| 36 | + developers { |
| 37 | + developer { |
| 38 | + id = 'asolntsev' |
| 39 | + name = 'Andrei Solntsev' |
65 | 40 | } |
66 | 41 | } |
67 | | - } |
68 | | - } |
69 | | - |
70 | | - if (project.hasProperty("signing.keyId")) { |
71 | | - apply plugin: 'signing' |
72 | | - |
73 | | - signing { |
74 | | - sign publishing.publications.mavenJava |
| 42 | + scm { |
| 43 | + connection = 'scm:git@github.com:java-testkit/assertlog.git' |
| 44 | + developerConnection = 'scm:git@github.com:java-testkit/assertlog.git' |
| 45 | + url = 'https://github.com/java-testkit/assertlog' |
| 46 | + } |
75 | 47 | } |
76 | 48 | } |
77 | 49 | } |
0 commit comments