Add Maven publishing

pull/103/head
StckOverflw 3 years ago
parent 9053da9529
commit 03c4663a35

@ -63,41 +63,33 @@ tasks {
} }
} }
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}
jar { jar {
from("LICENSE") { from("LICENSE") {
rename { "${it}_${archives_base_name}" } rename { "${it}_${archives_base_name}" }
} }
} }
}
/* val sourcesJar by creating(Jar::class) {
// configure the maven publication dependsOn(JavaPlugin.CLASSES_TASK_NAME)
publishing { archiveClassifier.convention("sources")
publications { from(sourceSets["main"].allSource)
mavenJava(MavenPublication) { }
// add all the jars that should be included when publishing to maven
artifact(remapJar) { publishing {
dependsOn(remapJar) publications {
} create<MavenPublication>("maven") {
artifact(sourcesJar) { // add all the jars that should be included when publishing to maven
dependsOn(remapSourcesJar) artifact(remapJar.get())
artifact(sourcesJar)
} }
} }
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories { repositories {
// Add repositories to publish to here. // Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level. // Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for // The repositories here will be used for publishing your artifact, not for
// retrieving dependencies. // retrieving dependencies.
}
} }
} }
*/

Loading…
Cancel
Save