如何在没有mvn clean install的情况下更改代码后构建项目? [英] how to build project after code changes without mvn clean install?

查看:381
本文介绍了如何在没有mvn clean install的情况下更改代码后构建项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在eclipse中有一个项目,一个带有appengine sdk的java应用程序和maven作为我的构建器。

I have a project in eclipse, a java app with appengine sdk and maven as my builder.

在我启动干净安装之前,.class文件不会刷新,所以我在代码中做的每一个改变都要运行:

The .class files are not refreshed until i launch clean install, so every change i do in code i have to run:


  • mvn clean install

  • mvn eclipse :clean

  • mvn eclipse:eclipse

然后尝试启动我的应用。

and then try to launch my app.

请帮助我,这真的很烦人。谢谢

Help me please it's really annoying. Thanks

推荐答案

您可能正在寻找热门部署功能。在使用webapp工作时,在大多数情况下仅仅编译java类是不够的 - 通常你必须创建一个war包,而且几乎总是你必须将新代码重新部署到app服务器。

You are probably looking for a hot deployment feature. When working wit ha webapp, in most cases it is not enough just to compile a java class - usually you have to create a war package, and nearly always you have to redeploy the new code to the app server.

mvn package 应足以创造战争。只要不删除或重命名任何文件,就不需要运行 mvn clean 。这会让事情变得更快。

mvn package should be enough to create the war. You don't need to run mvn clean as long as you don't remove or rename any file. That would make things faster.

要实现热部署(即在Web引擎开发服务器上即时获取新代码),您需要做一些额外的工作,然而。确保您使用 Google Plugin for Eclipse - 您可以使用它和maven一起该插件至少应该处理静态文件的热部署。使用Eclipse在调试模式下运行应用程序有点帮助,并且它能够动态替换方法的主体。

To achieve hot deployment (i.e. to get the new code instantaneously on the web-engine dev server) you need to do do some extra work, however. Make sure you use the Google Plugin for Eclipse - you can use it along with maven. The plugin at least should take care of static files hot deployment. Running the application in debug mode with Eclipse helps a bit as well as it is capable of replacing the methods' bodies on the fly.

查找更多信息答案问题

这篇关于如何在没有mvn clean install的情况下更改代码后构建项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆