Reputation: 14968
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 there is an archetype to configure a maven project to use it and create an empty console application.
Upvotes: 23
Views: 12139
Reputation: 27904
"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!" );
}
}
Upvotes: 9
Reputation: 3880
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!
Upvotes: 14