Skip to content

Allow to ignore frontend execution error (non-zero exit code)Β #850

@vincentmigot

Description

@vincentmigot

Hi,
First thanks for this awesome plugin :)

State:
I currently use it with yarn to build some JS project and I want to check existence of outdated libraries during build BUT I don't want the build to fail if there are (because it's not always a possibility to update to the latest version)

My problem is that "yarn outdated" command as well as "npm outdated" return a non-zero exit status if there is any outdated library inside my package.json.

So if I add the following execution part in my pom.xml, it break the build if any outaded library is found:

<execution>
    <id>check outdated libraries which break build if not all libraries are up to date</id>
    <goals>
        <goal>yarn</goal>
    </goals>
    <configuration>
        <arguments>outdated</arguments>
    </configuration>
</execution>

What I wish:
I wan't to be able to add an option into an execution part to ignore non-zero exit like that:

<execution>
    <id>check outdated libraries</id>
    <goals>
        <goal>yarn</goal>
    </goals>
    <configuration>
        <arguments>outdated</arguments>
        <ignoreErrors>true</ignoreErrors>
    </configuration>
</execution>

Workaround found so far:
After looking into the plugin code I found that I can do as follow:

  • Specify the phase <phase>test</phase> into the execution block
  • Specify the option <testFailureIgnore>true</testFailureIgnore> in configuration block

But this is very ugly because it log an error "There are test failures." which is not accurate at all and print an ugly non-sense stack trace in the middle of the build log.

Suggestion:
I have made a pull request (link to come) which add an available option <ignoreErrors>true</ignoreErrors> (false by default) for the configuration block.
I indicate in the javadoc that this option is NOT RECOMMENDED as well as testFailureIgnore option.

If you have any better solution I'm open to any suggestion and have some time to work on it if it requires any further development.

Thanks
Vincent Migot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions