CircleCI-Public / maven-orb

Simplify common tasks for building and testing Java projects using Maven on CircleCI.
https://circleci.com/orbs/registry/orb/circleci/maven
MIT License
6 stars 11 forks source link

Custom Maven command with additional arguments not working #34

Closed sivaprasadreddy closed 1 year ago

sivaprasadreddy commented 1 year ago

My maven orb usage:

version: 2.1
orbs:
  maven: circleci/maven@1.4.0
workflows:
  build_and_test:
    jobs:
      - maven/test:
          command: 'test -DforkCount=4'

This is failing with following error:

#!/bin/bash -eo pipefail
#!/bin/bash

if [ -n "$PARAM_SETTINGS_FILE" ]; then
    set -- "$@" --settings "$PARAM_SETTINGS_FILE"
fi

set -x
"$PARAM_MVN_COMMAND" "$PARAM_COMMAND" "$@"
set +x
+ mvn 'test -DforkCount=4'
...
...
[ERROR] Unknown lifecycle phase "test -DforkCount=4". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR] 

Maven Orb 1.4.0 is treating entire command as maven goal. The same config with circleci/maven@1.3.0 is working fine.