发布

  • fix(maven): add support for unbound goals in plugin targets (#33191)

    frostbyte_neo 发布于 2025-10-22 22:16:50 +00:00

    Current Behavior

    Maven plugin targets are only created for goals explicitly bound to
    executions in the POM. Goals defined in a plugin but not bound to any
    execution are not available as Nx targets.

    Expected Behavior

    All available Maven goals should be accessible as Nx targets, including:

    • Goals bound to executions (existing behavior)
    • Unbound goals defined in the plugin (new behavior)

    Changes Made

    1. Added unbound goal support: The NxTargetFactory now creates
      targets for goals defined in a plugin but not bound to any execution.
      These targets are created with the format goalPrefix:goalName without
      an execution ID.

    2. Added continuous build tracking:

    • Added continuous property to NxTarget data class to track whether
      a goal supports continuous builds
    • Updated MojoAnalyzer to detect continuous goals from the cache
      configuration
      • All targets now properly propagate continuous mode information
    1. Code improvements:
      • Improved formatting and indentation for consistency
    • Made execution parameter optional in createSimpleGoalTarget to
      support both bound and unbound goals
      • Updated command generation to work with or without execution IDs

    Related Issue(s)

    This change enables better Maven goal discovery and execution in Nx
    monorepos.

    下载附件