Skip to content

Align Java package naming with Maven groupId (gov.nist.secauto.metaschema → dev.metaschema) #616

@david-waltermire

Description

@david-waltermire

Summary

Rename all Java packages from gov.nist.secauto.metaschema.* to dev.metaschema.* to align with the Maven groupId dev.metaschema.java.

Motivation

Having aligned Maven coordinates and Java package names is best practice because it:

  • Provides intuitive artifact-to-package mapping
  • Improves traceability (easy to find which artifact provides a package)
  • Aligns JPMS module names with both groupId and packages
  • Reflects the project's evolution to a community-driven model

Current State

Element Value
Maven groupId dev.metaschema.java
Java packages gov.nist.secauto.metaschema.*
JPMS modules gov.nist.secauto.metaschema.*

Target State

Element Value
Maven groupId dev.metaschema.java (unchanged)
Java packages dev.metaschema.*
JPMS modules dev.metaschema.*

Impact Assessment

Scope Summary

Category Count
Java source files (main) 1,292
Java test files 292
Total Java files 1,584
Package reference occurrences ~43,000
JPMS module-info.java files 8
SPI service files (path rename) 4
pom.xml path references 6 locations
Documentation files 11

JPMS Module Renames

Current New
gov.nist.secauto.metaschema.core dev.metaschema.core
gov.nist.secauto.metaschema.databind dev.metaschema.databind
gov.nist.secauto.metaschema.schemagen dev.metaschema.schemagen
gov.nist.secauto.metaschema.cli.processor dev.metaschema.cli.processor
gov.nist.secauto.metaschema.cli dev.metaschema.cli
gov.nist.secauto.metaschema.databind.modules dev.metaschema.databind.modules
gov.nist.secauto.metaschema.maven.plugin dev.metaschema.maven.plugin
gov.nist.secauto.metaschema.testing dev.metaschema.testing

Files Requiring Special Attention

SPI Service Files (filename = interface FQCN):

  • META-INF/services/gov.nist.secauto.metaschema.core.datatype.IDataTypeProvider
  • META-INF/services/gov.nist.secauto.metaschema.core.metapath.function.IFunctionLibrary
  • META-INF/services/gov.nist.secauto.metaschema.cli.processor.command.ICommand

Generated Code Paths in pom.xml:

  • ANTLR4 parser output: gov/nist/secauto/metaschema/core/metapath/antlr
  • Databind generated classes exclusions

Bootstrap Binding Classes:

  • databind/.../config/binding/ - regenerate after rename
  • databind/.../model/metaschema/binding/ - regenerate after rename
  • metaschema-testing/.../testsuite/ - regenerate after rename

Breaking Change Notice

This is a breaking change requiring a major version bump.

All downstream users will need to:

  1. Update Maven dependencies (if groupId changes)
  2. Update all import statements
  3. Update JPMS requires directives
  4. Update SPI service file references
  5. Update any reflection-based code using FQCNs

Implementation Plan

Phase 1: Preparation

  • Create migration branch from develop
  • Document all downstream projects that need coordination
  • Prepare migration guide for users

Phase 2: Package Rename

  • Rename all Java package directories (gov/nist/secauto/metaschemadev/metaschema)
  • Update all import statements
  • Update all fully-qualified class name references

Phase 3: JPMS Updates

  • Update all module-info.java module names
  • Update all requires directives
  • Update all exports directives
  • Update all opens directives
  • Update all provides clauses

Phase 4: Configuration Updates

  • Rename SPI service files
  • Update SPI service file contents
  • Update pom.xml path references and exclusions
  • Update ANTLR4 output package configuration

Phase 5: Generated Code

  • Update Metaschema module namespaces (if applicable)
  • Regenerate bootstrap binding classes
  • Verify code generation still works

Phase 6: Documentation

  • Update CLAUDE.md
  • Update README files
  • Update skill documentation
  • Create migration guide for users

Phase 7: Verification

  • Full build with CI profile
  • All tests pass
  • Javadoc generation works
  • Site generation works
  • Maven plugin integration tests pass

Tools & Approach

Recommended approach using IDE refactoring or scripted rename:

# Example bulk rename approach (pseudocode)
# 1. Rename directories
find . -type d -path "*/gov/nist/secauto/metaschema*" | rename-script

# 2. Update file contents
find . -name "*.java" -exec sed -i 's/gov\.nist\.secauto\.metaschema/dev.metaschema/g' {} \;

# 3. Rename SPI files
mv META-INF/services/gov.nist.secauto.metaschema.* META-INF/services/dev.metaschema.*

Related Issues

  • Part of the project's transition to community governance
  • Aligns with Maven groupId change already completed

Labels

  • breaking-change
  • refactoring
  • major-version

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions