Skip to content

Error in bash method does not stop execution of whole command #9956

@romani

Description

@romani

problem detected at https://checkstyle.semaphoreci.com/jobs/4c7d4083-8c2b-4a13-9b3d-22a6d5a8b5cc#L619

CMD=mvn -e --no-transfer-progress clean install -Pno-validations && .ci/no-exception-test.sh guava-with-sun-checks

from code:

guava-with-google-checks)
CS_POM_VERSION="$(getCheckstylePomVersion)"
BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo CS_version: $CS_POM_VERSION

[INFO] BUILD SUCCESS 00:24
[INFO] ------------------------------------------------------------------------ 00:24
[INFO] Total time:  22.801 s 00:24
[INFO] Finished at: 2021-04-27T07:28:40Z 00:24
[INFO] ------------------------------------------------------------------------ 00:36
CS_version: [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.1
:exec (default-cli) on project checkstyle: Execution default-cli of goal org.codehaus.mojo:
exec-maven-plugin:1.3.1:exec failed: Plugin org.codehaus.mojo:exec-maven-plugin:1.3.1 
or one of its dependencies could not be resolved: Failed to collect dependencies at
 org.codehaus.mojo:exec-maven-plugin:jar:1.3.1 -> org.apache.commons:commons-exec:jar:1.2:
 Failed to read artifact descriptor for org.apache.commons:commons-exec:jar:1.2: 
Could not transfer artifact org.apache.commons:commons-exec:pom:1.2 from/to central (https://

final error is way confusing:

 01:55
[ERROR] 01:55
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 01:55
[ERROR] 01:55
[ERROR] For more information about the errors and possible solutions, please read the following 
articles: 01:55
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException 
01:55
Unable to parse command line options: Unrecognized option: -> 01:55
usage: mvn [options] [<goal(s)>] [<phase(s)>] 01:55
Options: 01:55
 -am,--also-make                        If project list is specified, also 01:55
                                        build projects required by the 01:55
                                        list

Expected: fail execution fast.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions