-
Bug
-
Resolution: Done
-
Blocker
-
Pipelines 1.16.0
-
None
-
3
-
False
-
None
-
False
-
-
-
Pipelines Sprint TekShift 13
Description of problem:
Maven task fails because it tries to create settings.xml file in wrong path
Workaround
Prerequisites (if any, like setup, operators/versions):
1.16.0
Steps to Reproduce
apiVersion: tekton.dev/v1 kind: Pipeline metadata: name: maven-pipeline spec: workspaces: - name: source - name: maven_settings tasks: - name: clone-git-repo taskRef: resolver: cluster params: - name: kind value: task - name: name value: git-clone - name: namespace value: openshift-pipelines workspaces: - name: output workspace: source params: - name: URL value: https://github.com/jboss-openshift/openshift-quickstarts.git - name: REVISION value: master - name: DELETE_EXISTING value: "true" - name: SUBDIRECTORY value: $(context.pipelineRun.name) - name: build taskRef: resolver: cluster params: - name: kind value: task - name: name value: maven - name: namespace value: openshift-pipelines params: - name: SUBDIRECTORY value: $(context.pipelineRun.name)/undertow-servlet runAfter: - clone-git-repo workspaces: - name: source workspace: source - name: maven_settings workspace: maven_settings
apiVersion: tekton.dev/v1 kind: PipelineRun metadata: name: maven-run spec: pipelineRef: name: maven-pipeline timeouts: pipeline: 15m workspaces: - name: source persistentVolumeClaim: claimName: shared-pvc - name: maven_settings configMap: name: maven-settings
Actual results:
step-maven-generate /scripts/maven-generate.sh Running Script /scripts/maven-generate.sh cp: cannot create regular file '/workspace/source/maven-generate/settings.xml': No such file or directory Using '/workspace/source/maven-generate/settings.xml' copied from optional workspace maven-settings cat: /workspace/source/maven-generate/settings.xml: No such file or directory step-maven-goals [ERROR] Error executing Maven. [ERROR] The specified user settings file does not exist: /workspace/source/maven-run2/undertow-servlet/maven-generate/settings.xml
Expected results:
Maven build is executed
Reproducibility (Always/Intermittent/Only Once):
always
Acceptance criteria:
Definition of Done:
Build Details:
Additional info (Such as Logs, Screenshots, etc):
Notes
IMHO this part doesn't make sense, settings.xml should go to $HOME/.m2
declare -rx MAVEN_GENERATE_DIRECTORY="${WORKSPACES_SOURCE_PATH}/maven-generate" declare -rx MAVEN_SETTINGS_FILE="${MAVEN_GENERATE_DIRECTORY}/settings.xml"