Uploaded image for project: 'Maven Checkstyle Plugin'
  1. Maven Checkstyle Plugin
  2. MCHECKSTYLE-343

Default property expansions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      The Checkstyle plugins for Eclipse and IntelliJ IDEA both define a few default properties that are accessible in Checkstyle configuration, like the custom property expansions that can be defined by the Maven plugin (https://maven.apache.org/plugins/maven-checkstyle-plugin/examples/custom-property-expansion.html). Those two plugins have standardized on the same variables, which lets our dev team share one configuration file without any custom configuration for the two IDE plugins.

      Would it be possible for the Maven plugin to pass the same default values to Checkstyle, so that we wouldn't need to define them in each project's pom.xml?

      From Eclipse-CS:

      Built-in properties
      First there are some properties that are automatically expanded by the plug-in:
      
      ${basedir} & ${project_loc} - gets mapped to the current project directory
      
      ${workspace_loc} - gets mapped to the current Eclipse workspace directory
      
      ${config_loc} & ${samedir} - get mapped to the directory the configuration file lies in
      

      From CheckStyle-IDEA:

      Eclipse-CS Variable Support
      
      The following variables will be available if you have not otherwise overridden their values:
      
      basedir - mapped to the location of the current module file, or the project directory as a fallback.
      project_loc, workspace_loc - mapped to the project directory.
      config_loc, samedir - mapped to the directory the rules file is in, or the project directory for remote rules files (e.g. HTTP).
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            andyf-wealthfront Andy Feldman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: