maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tibordig...@apache.org
Subject [maven-surefire] 01/01: INFRA-16951 (HTTP 503 from repo.maven.apache.org)
Date Thu, 20 Sep 2018 21:08:17 GMT
This is an automated email from the ASF dual-hosted git repository.

tibordigana pushed a commit to branch settings
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git

commit 1263c9def9f5084bef259fe5051b4050e70d5b8e
Author: Tibor17 <tibordigana@apache.org>
AuthorDate: Thu Sep 20 21:50:25 2018 +0200

    INFRA-16951 (HTTP 503 from repo.maven.apache.org)
---
 Jenkinsfile | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 9de3f2f..66d45d4 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -122,17 +122,38 @@ timeout(time: 12, unit: 'HOURS') {
 def buildProcess(String stageKey, String jdkName, String jdkTestName, String mvnName, goals,
options, mavenOpts, boolean makeReports) {
     cleanWs()
     try {
+        def settingsXmlContent = '''
+        <settings>
+            <mirrors>
+                <mirror>
+                    <id>nexus</id>
+                    <mirrorOf>*</mirrorOf>
+                    <name>Sonatype Nexus</name>
+                    <url>https://repository.apache.org/content/groups/public</url>
+                </mirror>
+            </mirrors>
+        </settings>'''
+
         def mvnLocalRepoDir = null
         if (isUnix()) {
             sh 'mkdir -p .m2'
-            mvnLocalRepoDir = "${pwd()}/.m2"
+            sh 'mkdir -p .m2/repository'
+            mvnLocalRepoDir = "${pwd()}/.m2/repository"
+            sh 'touch .m2/settings.xml'
+            sh 'echo \"<settings/>\" > .m2/settings.xml'
+            //writeFile(file: '.m2/settings.xml', text: settingsXmlContent, encoding: 'UTF-8')
         } else {
             bat 'mkdir .m2'
-            mvnLocalRepoDir = "${pwd()}\\.m2"
+            bat 'mkdir .m2\\repository'
+            mvnLocalRepoDir = "${pwd()}\\.m2\\repository"
+            bat 'copy nul .m2\\settings.xml'
+            bat 'echo \"<settings/>\" > .m2\\settings.xml'
+            //writeFile(file: '.m2\\settings.xml', text: settingsXmlContent, encoding: 'UTF-8')
         }
 
         println "Maven Local Repository = ${mvnLocalRepoDir}."
         assert mvnLocalRepoDir != null : 'Local Maven Repository is undefined.'
+        options += ['-s', '.m2/settings.xml']
 
         stage("checkout ${stageKey}") {
             checkout scm


Mime
View raw message