[CHANGE] Implement Maven Publishing

This commit is contained in:
2023-11-08 20:57:08 +02:00
parent 8481afa16d
commit 9dbd7275b3
5 changed files with 61 additions and 7 deletions

View File

@@ -1,9 +1,26 @@
archivesBaseName = "ExampleMod-Common-${minecraft_version}"
// Adjust the output jar name here
archivesBaseName = "${mod_name}-Common-${minecraft_version}"
dependencies {
// Add your dependencies here
}
// Maven Publishing. Remove if not needed
publishing {
publications {
mavenJava(MavenPublication) {
artifactId base.archivesName.get()
from components.java
}
}
repositories {
// Add your maven repository here
maven {
url "file://" + System.getenv("local_maven")
}
}
}
/**
* ===============================================================================
* = DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING =

View File

@@ -1,4 +1,5 @@
archivesBaseName = "ExampleMod-Fabric-${minecraft_version}"
// Adjust the output jar name here
archivesBaseName = "${mod_name}-Fabric-${minecraft_version}"
dependencies {
// Add your own dependencies here
@@ -10,6 +11,22 @@ dependencies {
implementation(project(":Common"))
}
// Maven Publishing. Remove if not needed
publishing {
publications {
mavenJava(MavenPublication) {
artifactId base.archivesName.get()
from components.java
}
}
repositories {
// Add your maven repository here
maven {
url "file://" + System.getenv("local_maven")
}
}
}
/**
* ===============================================================================
* = DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING =

View File

@@ -1,4 +1,5 @@
archivesBaseName = "ExampleMod-Forge-${minecraft_version}"
// Adjust the output jar name here
archivesBaseName = "${mod_name}-Forge-${minecraft_version}"
dependencies {
// Add your dependencies here
@@ -7,6 +8,22 @@ dependencies {
implementation project(":Common")
}
// Maven Publishing. Remove if not needed
publishing {
publications {
mavenJava(MavenPublication) {
artifactId base.archivesName.get()
from components.java
}
}
repositories {
// Add your maven repository here
maven {
url "file://" + System.getenv("local_maven")
}
}
}
/**
* ===============================================================================
* = DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING =

View File

@@ -10,6 +10,7 @@ version = "${version_major}.${version_minor}.${version_patch}"
subprojects {
apply plugin: "xyz.wagyourtail.unimined"
apply plugin: "java"
apply plugin: 'maven-publish'
group = rootProject.group
version = rootProject.version

View File

@@ -1,6 +1,3 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
#Project
version_major=1
version_minor=0
@@ -10,6 +7,7 @@ project_group=com.author.examplemod
#Mod
mod_author=ExampleModAuthor
mod_id=examplemod
mod_name=ExampleMod
# Shared
minecraft_version=1.20.2
@@ -20,3 +18,7 @@ fabric_api=0.90.7+1.20.2
# Forge
forge_version=48.0.34
# Gradle Options
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false