Skip to content

Commit a978569

Browse files
committed
Update maven publishing.
1 parent df3ec88 commit a978569

File tree

1 file changed

+10
-22
lines changed

1 file changed

+10
-22
lines changed

gradle/maven.gradle

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,48 +18,36 @@ if (!(project.hasProperty('group') || project.hasProperty('groupId'))) {
1818
if (canLoad) {
1919

2020
project.logger.lifecycle('Loading maven module.')
21-
21+
22+
// -- MAVEN PUBLISHING --
2223
project.publishing {
2324

24-
tasks.publish.dependsOn 'build'
25-
2625
publications {
2726

2827
mavenJava(MavenPublication) {
29-
30-
artifactId project.archivesBaseName
31-
32-
// Base mod archive.
33-
artifact jar
34-
35-
// Adds the sources as an artifact.
36-
artifact project.sourcesJar {
37-
classifier 'sources'
38-
}
3928

40-
// Adds the javadocs as an artifact.
41-
artifact project.javadocJar {
42-
classifier 'javadoc'
43-
}
29+
artifactId = base.archivesName.get()
30+
from components.java
31+
fg.component(it)
4432
}
4533
}
4634

4735
repositories {
48-
36+
4937
maven {
50-
38+
5139
// Sets maven credentials if they are provided. This is generally
5240
// only used for external/remote uploads.
5341
if (project.hasProperty('mavenUsername') && project.hasProperty('mavenPassword')) {
54-
42+
5543
credentials {
56-
44+
5745
username findProperty('mavenUsername')
5846
password findProperty('mavenPassword')
5947
}
6048
}
6149

62-
url getRequiredString('mavenURL')
50+
url getDefaultString('mavenURL', 'undefined', true)
6351
}
6452
}
6553
}

0 commit comments

Comments
 (0)