Skip to content

Commit 459aacc

Browse files
authored
Merge pull request #2258 from rnc/SETTINGSPATH
Fix settings.xml path
2 parents ce3adc9 + 10794a0 commit 459aacc

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

deploy/tasks/maven-deployment.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,14 @@ spec:
2525
- name: MVN_USERNAME
2626
description: Maven repository username
2727
type: string
28+
default: ""
2829
- name: MVN_PASSWORD
2930
description: Name of the secret holding the Maven repository password
3031
type: string
32+
- name: MVN_SERVER_ID
33+
description: Server identification in Maven settings.
34+
type: string
35+
default: "indy-mvn"
3136
- name: ACCESS_TOKEN
3237
description: Access token for OAuth.
3338
type: string
@@ -66,10 +71,6 @@ spec:
6671
cpu: 10m
6772
memory: 512Mi
6873
env:
69-
- name: MVN_REPO
70-
value: $(params.MVN_REPO)
71-
- name: MVN_USERNAME
72-
value: $(params.MVN_USERNAME)
7374
- name: MAVEN_PASSWORD
7475
valueFrom:
7576
secretKeyRef:
@@ -82,4 +83,5 @@ spec:
8283
- --directory=/var/workdir/deployment
8384
- --mvn-repo=$(params.MVN_REPO)
8485
- --mvn-username=$(params.MVN_USERNAME)
85-
- --mvn-settings=/var/workdir/settings.xml
86+
- --server-id=$(params.MVN_SERVER_ID)
87+
- --mvn-settings=/var/workdir/settings/settings.xml

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public void run() {
4949
throw new RuntimeException("Deploy failed");
5050
}
5151
if (isNotEmpty(mvnSettings)) {
52+
if (!Path.of(mvnSettings).toFile().exists()) {
53+
Log.errorf("Invalid Maven settings path: %s", mvnSettings);
54+
throw new RuntimeException("Invalid Maven settings");
55+
}
5256
System.setProperty("maven.settings", mvnSettings);
5357
}
5458
if (isNotEmpty(mvnRepo)) {

pkg/apis/jvmbuildservice/v1alpha1/systemconfig_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ const (
4949
KonfluxGitDefinition = "https://raw.githubusercontent.com/konflux-ci/build-definitions/refs/heads/main/task/git-clone/0.1/git-clone.yaml"
5050
KonfluxPreBuildDefinitions = "https://raw.githubusercontent.com/redhat-appstudio/jvm-build-service/main/deploy/tasks/pre-build.yaml"
5151
KonfluxBuildDefinitions = "https://raw.githubusercontent.com/konflux-ci/build-definitions/refs/heads/main/task/buildah-oci-ta/0.2/buildah-oci-ta.yaml"
52-
KonfluxMavenDeployDefinitions = "https://raw.githubusercontent.com/redhat-appstudio/jvm-build-service/main/deploy/tasks/maven-deployment.yaml"
52+
KonfluxMavenDeployDefinitions = "https://raw.githubusercontent.com/rnc/jvm-build-service/SETTINGSPATH/deploy/tasks/maven-deployment.yaml"
5353
)

pkg/reconciler/dependencybuild/buildrecipeyaml.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,13 @@ use-archive oci:$URL@$AARCHIVE=%s`, orasOptions, registryArgsWithDefaults(jbsCon
654654
StringVal: v1alpha1.MavenSecretName,
655655
},
656656
},
657+
{
658+
Name: "MVN_SERVER_ID",
659+
Value: tektonpipeline.ParamValue{
660+
Type: tektonpipeline.ParamTypeString,
661+
StringVal: "jbs-server",
662+
},
663+
},
657664
{
658665
Name: "JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE",
659666
Value: tektonpipeline.ParamValue{

0 commit comments

Comments
 (0)