Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-14577

Building a bootable JAR throws NPE when feature pack <location> element content is not well formed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • None
    • 23.0.0.Final
    • Build System
    • None
    • Hide

      Run a reproducer:

      # clone an example app repo
      $ git clone git@github.com:fabiobrz/bootablejar-json-logging-example.git
      $ cd bootablejar-json-logging-example/
      # this will work
      $ mvn clean package
      ...
      [INFO] CLI scripts execution done.
      [INFO] Executing CLI, CLI Session, scripts=[scripts/logging.cli], resolve-expressions=true, properties-file=null
      [INFO] CLI scripts execution done.
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESS
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  20.466 s
      [INFO] Finished at: 2021-03-16T13:12:30+01:00
      [INFO] ------------------------------------------------------------------------
      

      To see the NPE just pass an empty value for one of the properties used in the WildFly Feature Pack <location> element:

      $ mvn clean package -Djboss.xp.galleon.feature.pack.groupid=
      ...
      [INFO] Building server based on [[:wildfly-galleon-pack:22.0.0.Final inherit-packages=false inheritConfigs=false]] galleon feature-packs
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  2.081 s
      [INFO] Finished at: 2021-03-16T13:23:32+01:00
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.wildfly.plugins:wildfly-jar-maven-plugin:2.0.2.Final:package (default) on project bootablejar-json-logging-example: Execution default of goal org.wildfly.plugins:wildfly-jar-maven-plugin:2.0.2.Final:package failed.: NullPointerException -> [Help 1]
      
      Show
      Run a reproducer: # clone an example app repo $ git clone git@github.com:fabiobrz/bootablejar-json-logging-example.git $ cd bootablejar-json-logging-example/ # this will work $ mvn clean package ... [INFO] CLI scripts execution done. [INFO] Executing CLI, CLI Session, scripts=[scripts/logging.cli], resolve-expressions= true , properties-file= null [INFO] CLI scripts execution done. [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 20.466 s [INFO] Finished at: 2021-03-16T13:12:30+01:00 [INFO] ------------------------------------------------------------------------ To see the NPE just pass an empty value for one of the properties used in the WildFly Feature Pack <location> element: $ mvn clean package -Djboss.xp.galleon.feature.pack.groupid= ... [INFO] Building server based on [[:wildfly-galleon-pack:22.0.0.Final inherit-packages= false inheritConfigs= false ]] galleon feature-packs [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.081 s [INFO] Finished at: 2021-03-16T13:23:32+01:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.wildfly.plugins:wildfly-jar-maven-plugin:2.0.2.Final: package ( default ) on project bootablejar-json-logging-example: Execution default of goal org.wildfly.plugins:wildfly-jar-maven-plugin:2.0.2.Final: package failed.: NullPointerException -> [Help 1]
    • Undefined

    Description

      The plugin throws a NPE in case the feature pack <location> contents are not in the expected format, i.e.: %s:%s:%s

      Of course it is expected that the format must be valid but maybe a basic validation would avoid the NPE and improve the UX by providing a detailed message.

      See https://github.com/wildfly-extras/wildfly-jar-maven-plugin/issues/213

      Attachments

        Issue Links

          Activity

            People

              jdenise@redhat.com Jean Francois Denise
              fburzigo Fabio Burzigotti
              Jan Kašík, Jean Francois Denise
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: