0

Our project enabled Cloud SDK Pipeline. Upon a pull request, the pr job from Pipeline was triggered, and it tried to build with artifacts downloaded from: https://repo.maven.apache.org/maven2. However some dependencies of the project are not available in that repo. We would expect to connect to Nexus repo by default, as all dependencies are available there. Is it possible to configure docker in that way?

12:46:45 [ERROR] Non-resolvable import POM: Could not find artifact com.sap.sgs:security-patched-spring-boot-dependencies:pom:2.1.7.RELEASE-sap-06 in central (https://repo.maven.apache.org/maven2) @ line 28, column 22

12:46:45 [ERROR] 'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-test:jar is missing. @ line 183, column 19

12:46:45 [ERROR] 'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-actuator:jar is missing. @ line 187, column 19

12:46:45 [ERROR] 'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-aop:jar is missing. @ line 191, column 19

Nico Griffioen
  • 5,143
  • 2
  • 27
  • 36

2 Answers2

1

You can configure this in own settings file as described in the maven documentation

And then configure the settings file in the pipeline config as described in the pipeline guide.

Example Settings file

<settings>
<mirrors>
<mirror>
  <id>internal-repository</id>
  <name>Maven Repository Manager running on repo.mycompany.com</name>
  <url>http://repo.mycompany.com/proxy</url>
  <mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
</settings>

Sample pipeline config

mavenExecute:
  dockerImage: maven:3.6.1-jdk-8-alpine
  projectSettingsFile: "settings.xml"
Ram
  • 1,154
  • 6
  • 22
0

The Cx Server comes with a read-only download cache to boost build performance and reduce redundant downloads of dependencies. It is active by default and transparently injected into maven and npm builds. By default it uses maven central and the official npm registry for looking up and downloading dependencies.

To set up a custom maven or npm repository, e.g., a corporate nexus that also holds internal artifacts, you can use the attributes mvn_repository_url and npm_repository_url in server.cfg (make sure to stop, remove, and start the Cx Server after making the configuration change).

More information can be found in the Cx Server operations guide: https://github.com/SAP/devops-docker-cx-server/blob/master/docs/operations/cx-server-operations-guide.md#configuring-the-cx-server

Benjamin
  • 217
  • 2
  • 10