Skip to content
/ mvnexec Public

bash script to find and execute java classes with main methods

Notifications You must be signed in to change notification settings

albfan/mvnexec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 

Repository files navigation

#mvnexec

A script to find java files inside your maven project containing a main function without touching pom.xml

##Installation

Download and symlink to your path

$ git clone git@github.com:albfan/mvnexec.git
$ cd mvnexec
$ ln -s $PWD/mvnexec ~/bin/

##Usage

mvnexec honors JDK_HOME, JAVA_HOME system vars and java executable existing in PATH (in that order).

launch it from a maven project

$ cd <maven-project>
$ mvnexec
  1. First you will see a list of classes having main methods
  2. Next you will be prompted for parameters (press <Enter> if none is required or launch with -P)
  3. Program is compiled and launched (launch with -B to avoid compiling again)

##Features

Try using mvnexec --help

  • avoid to change pom.xml to test classes with main methods
  • -q or --quiet behave quiet. Don't show noisy [INFO] messages from maven
  • Support project classpath resolving for any java version

About

bash script to find and execute java classes with main methods

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages