20

Is it possible to generate a maven stub project via mvn archetype:generate that has a main function, and part of the build process includes making a App.cmd/App.sh to run the app from a shell?

It seems that I need the maven-shade-plugin to create a console app jar with wrapper scripts for command line startup. However, I don't know if their is an archtype to configure a maven project to use it and create an empty console app.

Justin Dearing
  • 14,270
  • 22
  • 88
  • 161

2 Answers2

12

The "Simple" archetype creates a maven project with a class that has a "main" method. Use that with your maven-shade-plugin to create an executable jar and you are good to go!

DaShaun
  • 3,722
  • 2
  • 27
  • 29
7

"org.apache.maven.archetypes" "maven-archetype-quickstart" (version 1.1) worked for me.

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        System.out.println( "Hello World!" );
    }
}
granadaCoder
  • 26,328
  • 10
  • 113
  • 146