Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-5476

[REGRESSION] @required parameter not being enforced for arrays

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Auto Closed
    • 3.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.1.0, 3.1.1
    • None
    • POM
    • None

    Description

      For a plugin that has the following parameters defined:

          /**
           * The message flows to be added to the bar file.
           * @parameter expression="${msgFlows}"
           * @required
           */
          private String[] msgFlows;
      
          /**
           * The message sets to be added to the bar file.
           * @parameter expression="${msgSets}"
           * @required
           */
          private String[] msgSets;
      

      and a pom config snippet of (note missing the msgSets):

                          <configuration>
                              <msgFlows>
                                  <msgFlow/>
                              </msgFlows>
                          </configuration>
      

      maven 2.x (2.09 and 2.2.1) will correctly fail with the following error:

      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] One or more required plugin parameters are invalid/missing for 'message-broker:package-bar-file'
      
      [0] Inside the definition for plugin 'maven-message-broker-plugin' specify the following:
      
      <configuration>
      ...
      <msgSets>VALUE</msgSets>
      </configuration>
      
      OR
      
      on the command line, specify: '-DmsgSets=VALUE'
      

      However, maven 3.x (3.0-beta-1 through to 3.0.5) do NOT enforce this.

      I would expect the build to be failed in the same manner as 2.x.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              chrisgwarp Chris Graham
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: