Skip to content

[MNG-8758] CLAPP #10316

Open
Open

Description

@jira-importer

Tamas Cservenak opened MNG-8758 and commented

We modified CLI way of working, and we opened up Maven to contain multiple CLI tools by (almost) fully reusing the CLI infra we have, hence today we have aside of existing mvn CLI tools like {}mvnenc{}, mvnsh and upcoming mvnup and so on.

Problem with these "extra tools" is that they (along with their dependencies) have to reside in Maven Core /lib directory. The tools like mvnenc and mvnsh had "luck" that all they need (plexus sec dispatcher and JLine) are already in core, but any new tool we'd like to add, may need dependencies not present in {}/lib{}, potentially bloating it.

Proposal: Maven CLAPP – like "Maven Command Line App".


No further details from MNG-8758

Activity

  1. added
    enhancement
    priority:major
    on Jul 7, 2025
  2. marked [MNG-8758] CLAPP #9532 as a duplicate of this issue on Jul 8, 2025
  3. Tarun4201 commented on Sep 27, 2026

    @Tarun4201
    Contributor

    Solution & Implementation Summary for [MNG-8758] Maven CLAPP

    We have implemented the Maven CLAPP (Command Line App) feature on branch feature/MNG-8758-clapp (Commit 6b4bd5521aae7f33b84a337b02ef27b377a6ba56).

    Key Architectural Changes

    1. MavenClappCling Entry Point:

    • Added org.apache.maven.cling.MavenClappCling which handles isolated class-loading for extra Maven CLI tools.
    • Dynamically builds a URLClassLoader pointing to ${maven.home}/lib/clapp/<toolName>/ jars and delegates execution to the tool's main class.
      2. ClassWorlds & Assembly Configuration:
    • Updated m2.conf to include optionally ${maven.home}/lib/clapp/${maven.clapp.name}/*.jar.
    • Updated component.xml to include lib/clapp/ in Maven distribution builds.
      3. Launcher Script (mvn):
    • Added support for --clapp <toolName> and --clapp=<toolName>.
    • Reads clapp.properties (key mainClass) from ${maven.home}/lib/clapp/<toolName>/.
    • Injects -Dmaven.clapp.name and -Dmaven.clapp.mainClass system properties.
      4. Tests & Documentation:
    • Added MavenClappClingTest covering jar collection, classloader creation, and error handling.
    • Added lib/clapp/README.txt detailing directory specification and configuration format.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority:major

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions