Antoni Bertran
Antoni Bertran

Reputation: 33

OpenShift add custom Maven repository

I'm using <repository> in the pom.xml file but OpenShift can not resolve dependencies, continue gets data from mavenCentral

    <repositories>
        <repository>
            <id>central</id>
            <url>MYREPOURL</url>
        </repository>
    </repositories>

Any idea?

Upvotes: 3

Views: 3702

Answers (2)

rkifo
rkifo

Reputation: 56

You've to edit your BuildConfig in Openshift and add:

  strategy:
    sourceStrategy:
      env:
      - name: MAVEN_MIRROR_URL
        value: http://your.local.artifactory.

And build again.

Reference: https://blog.openshift.com/improving-build-time-java-builds-openshift/

Upvotes: 4

Vy Do
Vy Do

Reputation: 52516

  • Look for file settings.xml at

${maven.home}/conf/settings.xml or

${user.home}/.m2/settings.xml

  • Create your own Maven profile.
  • Specify your own repository.
  • Set your profile is active.

Reference:

https://maven.apache.org/settings.html#Active_Profiles

https://maven.apache.org/settings.html#Repositories

Upvotes: 0

Related Questions