Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-21635

Use maven enforcer to ban imports from illegal packages

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0-alpha-1, 2.2.0, 2.1.2, 2.0.4
    • build
    • None
    • Reviewed
    • Hide
      Use de.skuzzle.enforcer.restrict-imports-enforcer-rule extension for maven enforcer plugin to ban illegal imports at compile time. Now if you use illegal imports, for example, import com.google.common.*, there will be a compile error, instead of a checkstyle warning.
      Show
      Use de.skuzzle.enforcer.restrict-imports-enforcer-rule extension for maven enforcer plugin to ban illegal imports at compile time. Now if you use illegal imports, for example, import com.google.common.*, there will be a compile error, instead of a checkstyle warning.

    Description

      Now we use checkstyle to report the illegal imports, but it will be easy to be ignored by developpers.

      https://github.com/skuzzle/restrict-imports-enforcer-rule

      This is an extension for the maven enforcer plugin, which is used to ban imports, and the advantage is that it will cause a compile error, which is not likely to be ignored. The extension is not perfect, but I think it is worth a try.

      Attachments

        1. HBASE-21635.patch
          11 kB
          Duo Zhang

        Activity

          People

            zhangduo Duo Zhang
            zhangduo Duo Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: