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

find a scalable way to add deprecation information to parameter expressions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-alpha-3
    • 2.0-beta-1
    • Plugins and Lifecycle
    • None

    Description

      Currently, most aspects of mojo development accommodate some sort of deprecation process. Methods can be deprecated using standard Java language support, and any given mojo can declare one of its parameters as deprecated. However, we do not currently support deprecation of the parameters available to mojo developers.

      A case in point is ${project.build.resources}. Ideally, we should not be modifying the underlying Model at runtime; doing so will compromise our ability to write a fully resolved POM to disk (which should not encompass runtime additions, which could be dependent on a profile's activation) and similar functionality. Instead, to add resources and then access them, a mojo should use ${project.resources} and MavenProject.addResource(..) (both new). The most graceful way to encourage this switch would be to deprecate ${project.build.resources} from the parameter evaluator, and remove it later. Currently, this requires case-by-case exceptions to be coded directly into the PluginParameterExpressionEvaluator, which is not very elegant.

      One possible solution might be to simply put a list of deprecated expressions into the evaluator, and also maybe a list of banned expressions. First step in evaluation could be to check vs. these lists, and give appropriate warnings/errors when detected.

      Attachments

        Issue Links

          Activity

            People

              jdcasey John Dennis Casey
              jdcasey John Dennis Casey
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: