You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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".
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.
Activity
Tarun4201 commentedon Sep 27, 2026
Solution & Implementation Summary for [MNG-8758] Maven CLAPP
We have implemented the Maven CLAPP (Command Line App) feature on branch
feature/MNG-8758-clapp(Commit6b4bd5521aae7f33b84a337b02ef27b377a6ba56).Key Architectural Changes
1.
MavenClappClingEntry Point:org.apache.maven.cling.MavenClappClingwhich handles isolated class-loading for extra Maven CLI tools.URLClassLoaderpointing to${maven.home}/lib/clapp/<toolName>/jars and delegates execution to the tool's main class.2. ClassWorlds & Assembly Configuration:
m2.confto includeoptionally ${maven.home}/lib/clapp/${maven.clapp.name}/*.jar.component.xmlto includelib/clapp/in Maven distribution builds.3. Launcher Script (
mvn):--clapp <toolName>and--clapp=<toolName>.clapp.properties(keymainClass) from${maven.home}/lib/clapp/<toolName>/.-Dmaven.clapp.nameand-Dmaven.clapp.mainClasssystem properties.4. Tests & Documentation:
MavenClappClingTestcovering jar collection, classloader creation, and error handling.lib/clapp/README.txtdetailing directory specification and configuration format.