update gradle settings to support local maven repo

This commit is contained in:
jane 2020-12-22 12:55:17 -05:00
parent 86c9b6e3f7
commit 4efc7c2081
3 changed files with 28 additions and 6 deletions

View File

@ -1,10 +1,12 @@
plugins {
id 'java'
id 'idea'
id 'fabric-loom' version '0.5.9'
id 'fabric-loom' version '0.6.9'
id 'maven-publish'
}
def ENV = System.getenv()
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
@ -12,6 +14,13 @@ archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
//declare extra repository for local maven
repositories {
maven {
url = 'http://192.168.1.156:8081/repository/maven-public/'
}
}
dependencies {
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
@ -21,6 +30,7 @@ dependencies {
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation "pm.j4:kerosene:${project.kerosene_version}"
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
// You may need to force-disable transitiveness on them.
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
@ -75,6 +85,14 @@ publishing {
// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
maven {
def snapshotsUrl = 'http://192.168.1.156:8081/repository/maven-snapshots/'
def releasesUrl = 'http://192.168.1.156:8081/repository/maven-releases/'
url = version.endsWith('SNAPSHOT') ? snapshotsUrl : releasesUrl
credentials {
username 'admin'
password ENV.MAVEN_PASSWORD
}
}
}
}

View File

@ -8,7 +8,8 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.10.8
# Mod Properties
mod_version = 0.1.4
mod_version = 0.1.5-SNAPSHOT
kerosene_version = 0.1.6-SNAPSHOT
maven_group = pm.j4
archives_base_name = petroleum

View File

@ -1,10 +1,13 @@
pluginManagement {
repositories {
jcenter()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
maven {
url = 'http://192.168.1.156:8081/repository/maven-public/'
}
jcenter()
gradlePluginPortal()
}
}