简体   繁体   English

使用NetBeans和Maven进行增量构建以进行码头热部署

[英]Incremental build with NetBeans and Maven for jetty hot deployment

After my unsuccessful attempt to run Tomcat with hot deployment from NetBeans with Maven, I've tried jetty. 尝试从NetBeans和Maven中通过热部署运行Tomcat失败之后,我尝试了Jetty。 The jetty-maven-plugin doc gave me an important hint: jetty-maven-plugin文档给了我一个重要提示:

The plugin will automatically ensure the classes are rebuilt and up-to-date before deployment. 该插件将自动确保在部署之前重建并更新了这些类。 If you change the source of a class and your IDE automatically compiles it in the background, the plug-in will pick up the changed class. 如果您更改了一个类的源,并且您的IDE会在后台自动编译它,则插件将获取更改后的类。

If I look at $myproject/target/classes/... in the projects directory, I can see that NetBeans doesn't compile and refresh the class file on saving. 如果我在projects目录中查看$ myproject / target / classes / ...,则可以看到NetBeans在保存时不会编译并刷新类文件。 I need to build the project explicitly to update the file and than jetty picks up the change. 我需要显式构建项目以更新文件,然后码头会接管更改。 (The plug-in param "scanIntervalSeconds" is set to 1.) (插件参数“ scanIntervalSeconds”设置为1。)

How can I tell NetBeans to compile on save and update the class file so that jetty can pick up the change? 我如何告诉NetBeans在保存并更新类文件时进行编译,以使Jetty可以获取更改?

Provisional solution: "Project Properties > Build > Compile > Compile On Save: For both application and test execution". 临时解决方案: “项目属性>构建>编译>保存时编译:适用于应用程序和测试执行”。 NetBeans warns me that the result is not the same as with a usal compiler run but it works so far. NetBeans警告我,结果与正常的编译器运行不同,但到目前为止它可以正常工作。

“项目属性”>“构建”>“编译”>“在保存时编译:适用于应用程序和测试执行”。NetBeans警告我,结果与通常的编译器运行不同,但目前为止可以使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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