Skip to content

Commit a154ebc

Browse files
committed
Pass maven settings through
1 parent b674871 commit a154ebc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

deploy/tasks/maven-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ spec:
7575
- deploy
7676
- --directory=/var/workdir/deployment
7777
- --mvn-repo=$(params.MVN_REPO)
78-
- --mvn-username=$(params.MVN_USERNAME)
78+
- --mvn-settings=/var/workdir/settings.xml

java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/deploy/DeployCommand.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ public class DeployCommand implements Runnable {
2828
@ConfigProperty(name = "maven.password")
2929
Optional<String> mvnPassword;
3030

31+
@CommandLine.Option(names = "--mvn-settings")
32+
String mvnSettings;
33+
3134
@CommandLine.Option(names = "--mvn-repo")
3235
String mvnRepo;
3336

@@ -45,6 +48,9 @@ public void run() {
4548
Log.warnf("No deployed artifacts found. Has the build been correctly configured to deploy?");
4649
throw new RuntimeException("Deploy failed");
4750
}
51+
if (isNotEmpty(mvnSettings)) {
52+
System.setProperty("maven.settings", mvnSettings);
53+
}
4854
if (isNotEmpty(mvnRepo)) {
4955
// Maven Repo Deployment
5056
MavenRepositoryDeployer deployer = new MavenRepositoryDeployer(mvnCtx, mvnUser, mvnPassword.orElse(""), mvnRepo, serverId, deploymentPath);

0 commit comments

Comments
 (0)