Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-21250

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • EAP-XP-3.0.0.CR1
    • EAP-XP-2.0.0.GA
    • Build System
    • None
    • False
    • False
    • Undefined
    • 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 -Peap
      ...
      [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 -Peap -Djboss.xp.galleon.feature.pack.groupid=
      ...
      [INFO] Building server based on [[:wildfly-galleon-pack:2.0.0.GA-redhat-00002 inherit-packages=false inheritConfigs=false]] galleon feature-packs
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  2.006 s
      [INFO] Finished at: 2021-03-16T13:27:18+01:00
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.wildfly.plugins:wildfly-jar-maven-plugin:2.0.2.Final-redhat-00001:package (default) on project bootablejar-json-logging-example: Execution default of goal org.wildfly.plugins:wildfly-jar-maven-plugin:2.0.2.Final-redhat-00001: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 -Peap ... [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 -Peap -Djboss.xp.galleon.feature.pack.groupid= ... [INFO] Building server based on [[:wildfly-galleon-pack:2.0.0.GA-redhat-00002 inherit-packages= false inheritConfigs= false ]] galleon feature-packs [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.006 s [INFO] Finished at: 2021-03-16T13:27:18+01:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.wildfly.plugins:wildfly-jar-maven-plugin:2.0.2.Final-redhat-00001: package ( default ) on project bootablejar-json-logging-example: Execution default of goal org.wildfly.plugins:wildfly-jar-maven-plugin:2.0.2.Final-redhat-00001: package failed.: NullPointerException -> [Help 1]

    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:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: