简体   繁体   中英

Spring Boot Maven plugin - How do I build a zip file with Java jar file and script to run it?

I have a simple Spring Boot Java application and am building it using the spring-boot-maven-plugin repackage goal.

I want to be able to package up the application, its dependencies and a script file that will be used to run the Java application, into a zip file. The script will be a Windows batch (.bat) script.

Does the plugin support this? I briefly looked at the plugin documentation, but couldn't find anything.

If this plugin is not able to do this, or if there is a better alternative, please let me know. I've worked with Maven in the past, but am a little rusty.

The spring-boot-maven-plugin is not capable of doing that.

But you can combine and using the maven-assembly-plugin to create the zip archive and creating a script like start.cmd (I would suggest to use .cmd instead .bat )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM