Skip to content

Commit 46ad19a

Browse files
committed
Update Forge Maven URL and Jenkinsfile.
1 parent 4b5bde9 commit 46ad19a

File tree

3 files changed

+23
-22
lines changed

3 files changed

+23
-22
lines changed

Jenkinsfile

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pipeline {
44
agent {
55
docker {
6-
image 'gradlewrapper:latest'
6+
image 'gradlew:jdk8'
77
args '-v gradlecache:/gradlecache'
88
}
99
}
@@ -38,39 +38,37 @@ pipeline {
3838
}
3939
stage('buildandtest') {
4040
steps {
41-
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue build test'
41+
withGradle {
42+
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue build test'
43+
}
4244
script {
4345
env.MYVERSION = sh(returnStdout: true, script: './gradlew properties -q | grep "version:" | awk \'{print $2}\'').trim()
4446
}
4547
}
46-
/*
47-
post {
48-
success {
49-
writeChangelog(currentBuild, 'build/changelog.txt')
50-
archiveArtifacts artifacts: 'build/changelog.txt', fingerprint: false
51-
}
52-
}
53-
*/
5448
}
5549
stage('publish') {
5650
when {
5751
not {
5852
changeRequest()
5953
}
6054
}
61-
environment {
62-
FORGE_MAVEN = credentials('forge-maven-forge-user')
63-
}
6455
steps {
65-
sh './gradlew ${GRADLE_ARGS} publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW}'
56+
withCredentials([usernamePassword(credentialsId: 'maven-forge-user', usernameVariable: 'MAVEN_USER', passwordVariable: 'MAVEN_PASSWORD')]) {
57+
withGradle {
58+
sh './gradlew ${GRADLE_ARGS} publish'
59+
}
60+
}
61+
}
62+
post {
63+
success {
64+
build job: 'filegenerator', parameters: [string(name: 'COMMAND', value: "promote ${env.MYGROUP}:${env.MYARTIFACT} ${env.MYVERSION} latest")], propagate: false, wait: false
65+
}
6666
}
6767
}
6868
}
6969
post {
7070
always {
7171
script {
72-
archiveArtifacts artifacts: 'build/libs/**/*.jar', fingerprint: true
73-
7472
if (env.CHANGE_ID == null) { // This is unset for non-PRs
7573
discordSend(
7674
title: "${DISCORD_PREFIX} Finished ${currentBuild.currentResult}",

build.gradle

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jar {
5353

5454
repositories {
5555
jcenter()
56-
maven { url = 'https://files.minecraftforge.net/maven' }
56+
maven { url = 'https://maven.minecraftforge.net/' }
5757
}
5858

5959
license {
@@ -117,12 +117,15 @@ publishing {
117117
}
118118
repositories {
119119
maven {
120-
if (project.hasProperty('forgeMavenPassword')) {
120+
if (System.env.MAVEN_USER) {
121+
url 'https://maven.minecraftforge.net/'
122+
authentication {
123+
basic(BasicAuthentication)
124+
}
121125
credentials {
122-
username project.properties.forgeMavenUser
123-
password project.properties.forgeMavenPassword
126+
username = System.env.MAVEN_USER ?: 'not'
127+
password = System.env.MAVEN_PASSWORD ?: 'set'
124128
}
125-
url 'https://files.minecraftforge.net/maven/manage/upload'
126129
} else {
127130
url 'file://' + rootProject.file('repo').getAbsolutePath()
128131
}

src/common/java/net/minecraftforge/gradle/common/util/Utils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public class Utils {
9797
.setPrettyPrinting().create();
9898
private static final int CACHE_TIMEOUT = 1000 * 60 * 60 * 1; //1 hour, Timeout used for version_manifest.json so we dont ping their server every request.
9999
//manifest doesn't include sha1's so we use this for the per-version json as well.
100-
public static final String FORGE_MAVEN = "https://files.minecraftforge.net/maven/";
100+
public static final String FORGE_MAVEN = "https://maven.minecraftforge.net/";
101101
public static final String MOJANG_MAVEN = "https://libraries.minecraft.net/";
102102
public static final String BINPATCHER = "net.minecraftforge:binarypatcher:1.+:fatjar";
103103
public static final String ACCESSTRANSFORMER = "net.minecraftforge:accesstransformers:1.0.+:fatjar";

0 commit comments

Comments
 (0)