开发者

Is there a maven archtype for creating a console app?

开发者 https://www.devze.com 2023-04-13 03:30 出处:网络
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?

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.


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!


"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!" );
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号