update maven config
@@ -425,21 +425,25 @@ task apiJar(type: Jar) {
task additionsJar(type: Jar) {
archiveName = "MekanismAdditions-${project.version}.jar"
+ classifier = "additions"
from sourceSets.additions.output
}
task defenseJar(type: Jar) {
archiveName = "MekanismDefense-${project.version}.jar"
+ classifier = "defense"
from sourceSets.defense.output
}
task generatorsJar(type: Jar) {
archiveName = "MekanismGenerators-${project.version}.jar"
+ classifier = "generators"
from sourceSets.generators.output
}
task toolsJar(type: Jar) {
archiveName = "MekanismTools-${project.version}.jar"
+ classifier = "tools"
from sourceSets.tools.output
}
@@ -576,40 +580,57 @@ task optimizePng {
}
}
-uploadArchives {
- if (System.getenv("LOCAL_MAVEN") != null) {
- repositories {
- mavenDeployer {
- repository(url: "file://" + System.getenv("LOCAL_MAVEN"))
+//properties to put in $HOME/.gradle/gradle.properties
+def MAVEN_PASSWORD_PROPERTY_NAME = 'mekanismMavenPassword'
+def MAVEN_URL_PROPERTY_NAME = 'mekanismMavenUrl'
+
+publishing {
+ publications {
+ maven(MavenPublication) {
+ from components.java
+ groupId = project.group
+ version = project.version
+ artifactId = project.archivesBaseName
+ artifacts = [apiJar, jar, generatorsJar, additionsJar, toolsJar, allJar]
pom {
groupId = project.group
version = project.version
if (System.getenv("MAVEN_ARTIFACT") != null) {
artifactId = System.getenv("MAVEN_ARTIFACT")
} else {
- artifactId = "Mekanism"
+ artifactId = project.archivesBaseName
}
- project {
name = "Mekanism"
packaging 'jar'
description 'Mekanism is a Minecraft add-on featuring high-tech machinery that can be used to create powerful tools, armor, and weapons.'
- url 'http://aidancbrady.com/mekanism/'
+ url = 'http://aidancbrady.com/mekanism/'
scm {
- url 'https://github.com/mekanism/Mekanism.git'
+ url = 'https://github.com/mekanism/Mekanism.git'
}
issueManagement {
- system 'github'
- url 'https://github.com/mekanism/Mekanism/issues'
+ system = 'github'
+ url = 'https://github.com/mekanism/Mekanism/issues'
}
licenses {
license {
name = 'MIT'
- distribution 'repo'
+ distribution = 'repo'
}
}
}
}
}
+ repositories {
+ maven {
+ if (project.findProperty(MAVEN_URL_PROPERTY_NAME) != null) {
+ url = project.findProperty(MAVEN_URL_PROPERTY_NAME)
+ }
+ if (project.findProperty(MAVEN_PASSWORD_PROPERTY_NAME) != null) {
+ credentials {
+ username = "mekanism"
+ password = project.findProperty(MAVEN_PASSWORD_PROPERTY_NAME)
+ }
+ }
}
}
}
