Uploaded image for project: 'Maven Plugin Tools'
  1. Maven Plugin Tools
  2. MPLUGIN-419

Allow @Parameter on setters methods

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.7.0
    • None
    • None

    Description

      We needn't filed for Mojo parameters.

      When setters method exist it is called first by Maven.

      We can declare Mojo as:

      @Mojo( name = "my-mojo" )
      public class MyMojo extends AbstractMojo
      {
          @Parameter
          private String param;
      
          public void execute()
          {
          }
      }
      

      In some case will be useful to have possibility to declare as:

      @Mojo( name = "my-mojo" )
      public class MyMojo extends AbstractMojo
      {
          @Parameter
          public void setParam(String param)
          {
              // do something with param
          }
      
          public void execute()
          {
          }
      }
      

      eg, useful:

      • normalization
      • validation
      • split one input value to more items, the same or other type

      Attachments

        Issue Links

          Activity

            People

              sjaranowski Slawomir Jaranowski
              sjaranowski Slawomir Jaranowski
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: