每次进行更改时都运行mvn软件包吗? [英] Run mvn package every time I make changes?
问题描述
首次使用docker-config.yml
文件处理 DropWizard 项目使用jar文件运行服务器.
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
我每次更改都必须运行mvn package
吗? (例如:即使是很小的更改,例如添加System.out.println()
语句以调试某些内容)
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)
推荐答案
mvn package
用于创建JAR-应用程序的可部署工件.因此,如果您真的想每次都创建JAR,是的,您需要打包所有内容.
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.
但是,通常,如果您谈论的是诸如添加System.out.println
之类的小改动,我认为您有一些正在进行的工作".在这种情况下,您可以配置IDE以使用main方法运行该类(就dropwizard框架而言,是Application类).它不会创建一个胖子罐,但是对于调试您也不是很需要.
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.
这是我(而且我相信我们的许多同事)在处理由dropwizard,spring-boot(在这方面类似)等应用程序时所做的工作.
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.
这篇关于每次进行更改时都运行mvn软件包吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!