Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Maven mirrors #124

Merged
merged 1 commit into from
May 2, 2024
Merged

Conversation

schnatterer
Copy link
Member

Can be tested with the GitOps Playground for example:

http://scmm.localhost/scm/repo/argocd/petclinic-plain/code/sources/main/Jenkinsfile/

Then change these lines:

String getCesBuildLibRepo() { "https://github.com/cloudogu/ces-build-lib/" }
String getCesBuildLibVersion() { '7e7e858' }


//. ..
node {

    mvn = cesBuildLib.MavenWrapper.new(this)
    mvn.useMirrors([name: 'google-maven', mirrorOf: 'central', url: 'https://maven-central.storage.googleapis.com/maven2/'])
    
    catchError {

        stage('Checkout') {
            checkout scm
        }

        stage('Build') {
            mvn 'clean package -DskipTests -Dcheckstyle.skip'
            archiveArtifacts artifacts: '**/target/*.jar'
        }
    
// ... def loadLibraries() 

    cesBuildLib = library(identifier: "ces-build-lib@${cesBuildLibVersion}",
            retriever: modernSCM([$class: 'GitSCMSource', remote: cesBuildLibRepo])
    ).com.cloudogu.ces.cesbuildlib

Then start a build on Jenkins: http://jenkins.localhost/job/example-apps/job/petclinic-plain/job/main/build?delay=0sec

An in the logs of this build you will see the mirror in action
image

@yannickchristhomas yannickchristhomas merged commit c20bb43 into develop May 2, 2024
2 checks passed
@schnatterer schnatterer deleted the feature/maven-mirrors branch September 30, 2024 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants