|
1 | | -apply plugin: 'maven-publish' |
2 | | - |
3 | 1 | jar { |
4 | 2 | manifest { |
5 | 3 | attributes( |
| 4 | + "Automatic-Module-Name": project.group + '.' + project.name.replace('-', '.'), |
6 | 5 | "Implementation-Title": project.group + '.' + project.name, |
7 | | - "Implementation-Version": version, |
8 | | - "Implementation-Vendor": "Codeborne" |
9 | | - ) |
| 6 | + "Implementation-Version": archiveVersion, |
| 7 | + "Implementation-Vendor": "Codeborne") |
10 | 8 | } |
11 | 9 | } |
12 | 10 |
|
13 | | -tasks.register('sourcesJar', Jar) { |
14 | | - dependsOn classes |
| 11 | +task sourcesJar(type: Jar) { |
15 | 12 | archiveClassifier = 'sources' |
16 | | - from sourceSets.main.allSource |
| 13 | + from sourceSets.main.allJava |
17 | 14 | } |
18 | 15 |
|
19 | | -tasks.withType(Javadoc).configureEach { |
20 | | - failOnError = false |
| 16 | +javadoc { |
21 | 17 | options.encoding = 'UTF-8' |
22 | | - source = sourceSets.main.allJava |
| 18 | + failOnError = false |
23 | 19 | } |
24 | 20 |
|
25 | | -tasks.register('javadocJar', Jar) { |
26 | | - dependsOn javadoc |
| 21 | +task javadocJar(type: Jar, dependsOn: javadoc) { |
27 | 22 | archiveClassifier = 'javadoc' |
28 | 23 | from javadoc.destinationDir |
29 | 24 | } |
30 | 25 |
|
31 | 26 | if (project.hasProperty("signing.keyId")) { |
32 | | - apply plugin: 'signing' |
33 | | - |
34 | | - signing { |
35 | | - afterEvaluate { |
36 | | - sign publishing.publications.mavenJava |
37 | | - } |
38 | | - } |
39 | | -} |
40 | | - |
41 | | -artifacts { |
42 | | - archives jar |
43 | | - archives sourcesJar |
44 | | - archives javadocJar |
45 | | -} |
46 | | - |
47 | | -publishing { |
48 | | - if (project.hasProperty("sonatypeUsername")) { |
49 | | - repositories { |
50 | | - maven { |
51 | | - name 'Maven' |
52 | | - url project.version.endsWith("-SNAPSHOT") ? |
53 | | - 'https://oss.sonatype.org/content/repositories/snapshots/' : |
54 | | - 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' |
55 | | - credentials { |
56 | | - username "$sonatypeUsername" |
57 | | - password "$sonatypePassword" |
| 27 | + mavenPublishing { |
| 28 | + pom { |
| 29 | + name = "xls-test" |
| 30 | + description = "XLS Test: Excel testing library" |
| 31 | + inceptionYear = "2015" |
| 32 | + url = "https://github.com/codeborne/xls-test" |
| 33 | + licenses { |
| 34 | + license { |
| 35 | + name = "MIT" |
| 36 | + url = "https://opensource.org/licenses/MIT" |
| 37 | + distribution = "https://opensource.org/licenses/MIT" |
58 | 38 | } |
59 | 39 | } |
60 | | - } |
61 | | - } |
62 | | - |
63 | | - publications { |
64 | | - mavenJava(MavenPublication) { |
65 | | - groupId "${project.group}" |
66 | | - artifactId "${project.name}" |
67 | | - |
68 | | - from components.java |
69 | | - artifact(sourcesJar) |
70 | | - artifact(javadocJar) |
71 | | - |
72 | | - pom { |
73 | | - name = archivesBaseName |
74 | | - description = 'XLS Test: Excel testing library, created by Codeborne.' |
75 | | - url = 'https://github.com/codeborne/xls-test' |
76 | | - licenses { |
77 | | - license { |
78 | | - name = 'MIT' |
79 | | - url = 'https://opensource.org/licenses/MIT' |
80 | | - } |
81 | | - } |
82 | | - developers { |
83 | | - developer { |
84 | | - id = 'asolntsev' |
85 | | - name = 'Andrei Solntsev' |
86 | | - } |
87 | | - } |
88 | | - scm { |
89 | | - connection = 'scm:git@github.com:codeborne/xls-test.git' |
90 | | - developerConnection = 'scm:git@github.com:codeborne/xls-test.git' |
91 | | - url = 'https://github.com/codeborne/xls-test' |
| 40 | + developers { |
| 41 | + developer { |
| 42 | + id = 'asolntsev' |
| 43 | + name = 'Andrei Solntsev' |
| 44 | + url = "https://github.com/asolntsev/" |
92 | 45 | } |
93 | 46 | } |
| 47 | + scm { |
| 48 | + url = "https://github.com/codeborne/xls-test" |
| 49 | + connection = "scm:git:git://github.com/codeborne/xls-test.git" |
| 50 | + developerConnection = "scm:git:ssh://git@github.com/codeborne/xls-test.git" |
| 51 | + } |
94 | 52 | } |
95 | 53 | } |
96 | 54 | } |
0 commit comments