exec-maven-plugin icon indicating copy to clipboard operation
exec-maven-plugin copied to clipboard

Hability to execute java ('exec:java') without requiring a maven project, and allow dependency resolution

Open tbrugz opened this issue 4 years ago • 1 comments

exec:java currently needs a maven project (pom.xml) to load the project dependencies in order to find the main class (and its dependencies). It would be nice to run a exec:java without this requirement, so the goal could resolve dependencies passed by command line arguments and run the main method (also passed by command line argument).

exec:java goal could be altered, or a new goal (say, exec:anyjava) could be created so the impact on exec:java would be minimum. Also, a mechanism similar to dependency:get would be needed to resolve the dependencies that are passed by command line.

I have some working code that I'll send in a PR soon.

tbrugz avatar Dec 04 '20 02:12 tbrugz

Hey, I do not know your use case, but JBang might suit your needs:

For example: https://github.com/apache/sling-whiteboard/blob/8c9d3aa8518b62af4a6f2e29c61d00db79fb9371/jbang/SlingStarter.java

bmarwell avatar Apr 08 '22 07:04 bmarwell