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

View file

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