Skip to content

Project structure and java package names #4832

Open

Description

@adangel

This is a follow-up issue from #4830. To be done in 7.x or 8.0.0:

Possible changes:

  • pmd-core: introduce base package net.sourceforge.pmd.core
    • no exception anymore, it's like any other module
  • move language modules in filesystem under a common directory, e.g. /pmd-java -> /pmd-languages/pmd-java
    • that way, we could have languages with the id of "core", "test", "ant", "doc", ...
    • Alternatively, prefix language module names, e.g. pmd-java -> pmd-lang-java
  • maybe get rid of prefix pmd - it's all about pmd anyway, don't need to repeat...
    • then we would have e.g. net.sourceforge.pmd:core - however, the artifactId should probably keep the prefix, since this will be the name of the jar file, and having a core.jar is not a good name.
    • But we could get rid of the pmd- prefix in the folders/git.
  • We have two modules, which contain multiple languages: pmd-javascript and pmd-xml.
    • How to deal with them? Is this ok?
  • Update ADR 3: https://docs.pmd-code.org/latest/pmd_projectdocs_decisions_adr_3.html#project-structure-and-java-base-packages-names

Activity

  1. added
    a:suggestion
    on Feb 23, 2024
  2. added this to the 7.x milestone on Feb 23, 2024
  3. UncleOwen commented on Jul 1, 2026

    @UncleOwen
    Member

    My personal opinions on these changes:

    * pmd-core: introduce base package `net.sourceforge.pmd.core`
      * no exception anymore, it's like any other module
    

    Yes, I think we should do that. Classes in a maven module named pmd-foo should be in a package under someprefix.pmd.foo. Makes perfect sense. And then we can use pmd.foo as the java jigsaw module name.

    * move language modules in filesystem under a common directory, e.g. /pmd-java -> /pmd-languages/pmd-java
      * that way, we could have languages with the id of "core", "test", "ant", "doc", ...
      * Alternatively, prefix language module names, e.g. pmd-java -> pmd-lang-java
    

    I like the second alternative better. Keeps the directory structure flat (all modules on the same level), and follows the rule I made up above.

    * maybe get rid of prefix pmd - it's all about pmd anyway, don't need to repeat...
      * then we would have e.g. `net.sourceforge.pmd:core` - however, the artifactId should probably keep the prefix, since this will be the name of the jar file, and having a `core.jar` is not a good name.
      * But we could get rid of the pmd- prefix in the folders/git.
    

    Eh... I don't like core.jar

    * We have two modules, which contain multiple languages: pmd-javascript and pmd-xml.
      * How to deal with them? Is this ok?
    

    I think we can just split up pmd-javascript. That's two language modules in one folder, but they share zero code, AFAICT. pmd-xml is only one language, XSL/WSDL/POM are now dialects, so that problem is already solved. What about pmd-scala-modules? What's the situation there?

    * Update ADR 3: https://docs.pmd-code.org/latest/pmd_projectdocs_decisions_adr_3.html#project-structure-and-java-base-packages-names
    
  4. UncleOwen commented on Jul 1, 2026

    @UncleOwen
    Member

    Linking #6839

  5. self-assigned this
    on Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a:suggestion

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions