Run mvn package every time I make changes?

允我心安 提交于 2020-02-23 06:54:48

问题


Working on a DropWizard project for the first time which uses the docker-config.yml file to run the server using the jar file.

The command I run on the terminal to run the server is something like this:

java -jar target/foo-0.0.1.jar server conf/docker-conf.yml

Do I have to run mvn package every single time I make a change? (for eg: even a small change like adding a System.out.println() statement to debug something)


回答1:


mvn package is used to create a JAR - a deployable artifact of the application. So if you really want to create the JAR every time, yes you need to package everything.

However, usually if you’re talking about small changes like adding System.out.println I assume that you have some “work-in-progress”. In this case you can configure your IDE to run the class with main method (the Application class in in terms of dropwizard framework). It won’t create a fat jar but for debugging you also don’t really need it.

This is what I (and I believe many of our colleagues) do when working with applications powered by dropwizard, spring-boot (which is similar in this aspect), etc.



来源:https://stackoverflow.com/questions/58717271/run-mvn-package-every-time-i-make-changes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!