Uploaded image for project: 'WildFly Maven Plugin'
  1. WildFly Maven Plugin
  2. WFMP-256

Server does not start if an environment variable is has no value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 5.0.1.Final
    • None
    • Maven Plugin
    • None

      Declaring a variable that do not have any value gives a unintuitive error. For example, using this siple configuration:

      <plugin>
          <groupId>org.wildfly.plugins</groupId>
          <artifactId>wildfly-maven-plugin</artifactId>
          <version>${version.plugin.wildfly}</version>
          <configuration>
              <env>
                  <TEST>${test}</TEST>
              </env>
          </configuration>
      </plugin>

      Provides the following error trace:

      [ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:5.0.0.Final:dev (default-cli) on project solar-system-tours: The server failed to start: Cannot invoke "String.indexOf(int)" because "value" is null -> [Help 1]
      [ERROR] 
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR] 
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
      

      The error is not intuitive since it says nothing about what is the root cause.

      I initially open it as a bug, I don't think the intention was to prevent adding env configurations without values, but if that was the case, at least the error could be improved to understan better which env has no value before passing it to the server launch command.

              jperkins-rhn James Perkins
              yborgess1@redhat.com Yeray Borges Santana
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: