mojohaus / mojohaus/exec-maven-plugin
Add ability to call any public static method as an alternate to main()
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 191
- Forks
- 111
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 4
Description
Some tools expose an alternate entrypoint method (not main()) for in-process calls. exec-maven-plugin having the ability to call any public static method taking a single String[] argument would be very nice in these situations, providing considerable additional versatility for very small cost in complexity.
As an example, the wsimport tool from jax-ws (https://github.com/eclipse-ee4j/metro-jax-ws/blob/master/jaxws-ri/tools/wscompile/src/main/java/com/sun/tools/ws/WsImport.java) has its main() forcefully terminating the process, making it unsuitable for in-process maven execution. But the WsImport class also exposes a public static int doMain(String[] args) which is explicitly documents as a being an "Entry point for tool integration". Being able to call this method instead of main() would make it possible to generate java code from wsdl in-process, speeding up builds considerably as repeatedly forking the wsimport process incurs sizeable performance overhead.
If you find this addition as valuable as I do, I could submit a PR that would add class and method optional plugin configuration parameters to the java goal. Specifying any of those parameters would override the current behavior of the mainClassparameter, preserving backward compatibility.
All comments and opinions gladly welcomed!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the exec-maven-plugin java goal and its existing mainClass behavior. Review the proposed optional class and method parameters, along with the WsImport doMain(String[] args) entry point, to determine the invocation requirements. Done means supporting public static String[] entry points while preserving current mainClass behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100