diff --git a/deploy/tasks/maven-deployment.yaml b/deploy/tasks/maven-deployment.yaml index 827dedb68..c703e6901 100644 --- a/deploy/tasks/maven-deployment.yaml +++ b/deploy/tasks/maven-deployment.yaml @@ -25,9 +25,14 @@ spec: - name: MVN_USERNAME description: Maven repository username type: string + default: "" - name: MVN_PASSWORD description: Name of the secret holding the Maven repository password type: string + - name: MVN_SERVER_ID + description: Server identification in Maven settings. + type: string + default: "indy-mvn" - name: ACCESS_TOKEN description: Access token for OAuth. type: string @@ -66,10 +71,6 @@ spec: cpu: 10m memory: 512Mi env: - - name: MVN_REPO - value: $(params.MVN_REPO) - - name: MVN_USERNAME - value: $(params.MVN_USERNAME) - name: MAVEN_PASSWORD valueFrom: secretKeyRef: @@ -82,4 +83,5 @@ spec: - --directory=/var/workdir/deployment - --mvn-repo=$(params.MVN_REPO) - --mvn-username=$(params.MVN_USERNAME) - - --mvn-settings=/var/workdir/settings.xml + - --server-id=$(params.MVN_SERVER_ID) + - --mvn-settings=/var/workdir/settings/settings.xml diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/deploy/DeployCommand.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/deploy/DeployCommand.java index 316b4d0c0..01c2a8ad0 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/deploy/DeployCommand.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/deploy/DeployCommand.java @@ -49,6 +49,10 @@ public void run() { throw new RuntimeException("Deploy failed"); } if (isNotEmpty(mvnSettings)) { + if (!Path.of(mvnSettings).toFile().exists()) { + Log.errorf("Invalid Maven settings path: %s", mvnSettings); + throw new RuntimeException("Invalid Maven settings"); + } System.setProperty("maven.settings", mvnSettings); } if (isNotEmpty(mvnRepo)) { diff --git a/pkg/apis/jvmbuildservice/v1alpha1/systemconfig_types.go b/pkg/apis/jvmbuildservice/v1alpha1/systemconfig_types.go index 8f6a33fd7..276fba02f 100644 --- a/pkg/apis/jvmbuildservice/v1alpha1/systemconfig_types.go +++ b/pkg/apis/jvmbuildservice/v1alpha1/systemconfig_types.go @@ -49,5 +49,5 @@ const ( KonfluxGitDefinition = "https://raw.githubusercontent.com/konflux-ci/build-definitions/refs/heads/main/task/git-clone/0.1/git-clone.yaml" KonfluxPreBuildDefinitions = "https://raw.githubusercontent.com/redhat-appstudio/jvm-build-service/main/deploy/tasks/pre-build.yaml" KonfluxBuildDefinitions = "https://raw.githubusercontent.com/konflux-ci/build-definitions/refs/heads/main/task/buildah-oci-ta/0.2/buildah-oci-ta.yaml" - KonfluxMavenDeployDefinitions = "https://raw.githubusercontent.com/redhat-appstudio/jvm-build-service/main/deploy/tasks/maven-deployment.yaml" + KonfluxMavenDeployDefinitions = "https://raw.githubusercontent.com/rnc/jvm-build-service/SETTINGSPATH/deploy/tasks/maven-deployment.yaml" ) diff --git a/pkg/reconciler/dependencybuild/buildrecipeyaml.go b/pkg/reconciler/dependencybuild/buildrecipeyaml.go index dcdc84966..8bf7bbfdf 100644 --- a/pkg/reconciler/dependencybuild/buildrecipeyaml.go +++ b/pkg/reconciler/dependencybuild/buildrecipeyaml.go @@ -654,6 +654,13 @@ use-archive oci:$URL@$AARCHIVE=%s`, orasOptions, registryArgsWithDefaults(jbsCon StringVal: v1alpha1.MavenSecretName, }, }, + { + Name: "MVN_SERVER_ID", + Value: tektonpipeline.ParamValue{ + Type: tektonpipeline.ParamTypeString, + StringVal: "jbs-server", + }, + }, { Name: "JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE", Value: tektonpipeline.ParamValue{