Netbeans部署保存:它应该如何工作? [英] Netbeans deploy on save: how is it supposed to work?

查看:141
本文介绍了Netbeans部署保存:它应该如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我试图在Netbeans上正确设置保存(或保存时编译,或者我应该设置的任何内容)。 :
$ b $ 1)如果结构没有改变,按需要热替换某个类(按下按钮,新代码替换旧代码)。
$ b 2)将我的jsf页面(.xhtml)复制到glassfish上保存

1)大多数情况下都是可用的;它有时不会在我多次部署后(为什么?),或者如果Netbeans决定因为什么原因而部署整个事情(有时候会这样)
2)在某个项目中工作,而不是在其他



看起来像黑魔法。

它应该如何工作?我似乎没有1)和2)在同一时间为我的所有项目工作。我应该如何配置?我必须做错了什么,我只需要知道清单是什么。



前段时间我打开了这个: https://netbeans.org/bugzilla/show_bug.cgi?id=218806



UPDATE:这是一个maven项目

解决方案

这个来自Jira问题的更新应该澄清它:


目前有两个重要特性:
- >保存时编译(将被称为CoS),这意味着您的java文件会在您保存
(通常是目标/类)时立即编译。



- >在保存(将被称为DoS)上部署为补充功能,使您可以在保存时立即将.class文件更改部署到服务器



因此,目前您几乎没有任何可能性:



<1>打开(CoS和DoS) - >那个意味着您更改后的.java文件
将在保存时被编译并重新部署到服务器,并且您的
静态资源(html,jsp等)将在
保存后被复制到服务器。 2)关闭DoS但让CoS开启 - >在这种情况下,您将释放
与服务器刷新相关的所有内容。这意味着你应该在目标/类中编译
实际的类文件,但是你不会在浏览器中看到
的任何变化



3)关掉 - > NB让你负责构建/部署



- >在禁用CoS时启用DoS并没有语义上的意义,这就是为什么如果禁用CoS,NetBeans会自动禁止
DoS


我应该如何配置?


所以这里的结论是,你没有做错任何事情,你
不能这样配置它。NetBeans只是不支持这样的
可能性呢。但好事是我现在开始在问题218345上工作
,这正是你需要的。将有一个新的
复选框(已经在Ant Web项目中提供)名为保存时复制静态
资源,允许您在DoS中复制html / jsp / jsf页面
禁用。



I'm trying to setup deploy on save (or compile on save, or whatever I should setup) correctly in Netbeans.

I'm trying to achieve this:

1) hot-replace some class when needed if the structure didn't change (push the button, new code replacing the old one)

2) copy my jsf pages (.xhtml) to glassfish on save

1) works most of the time; it sometimes doesn't after I deploy many times (why?), or if Netbeans decides for whatever reason that it should deploy the whole thing (it does... sometimes) 2) works in some project, not in others

Seems like black magic.

How is it supposed to work? I can't seem to have 1) and 2) working on the same time for all my projects. How should I configure that? I must have done something wrong, I just need to know what the checklist is.

I opened this some time ago: https://netbeans.org/bugzilla/show_bug.cgi?id=218806

UPDATE: this is a maven project

解决方案

This update from the Jira issue should clarify it:

At the moment there are two important features: --> Compile on Save (will be referred as CoS) which basically means that your java files are compiled immediately when you save them (typically to the target/classes).

--> Deploy on Save (will be referred as DoS) is supplementary feature that enables you to deploy your .class file changes to the server immediately when you save them.

So currently you have few possibilities:

1) Turn on both (CoS and DoS) --> That means your changed .java files will be compiled on save and redeployed to the server and also your static resources (html, jsp etc.) will be copied to the server after the save.

2) Turn DoS off but let CoS on --> in such case you will loose everything related to "server refresh". Which means you should have actual class files compiled in the target/classes but you won't see any change in the browser

3) Turn both off --> NB let you to take care of build/deployment

--> It doesn't make semantic sense to have DoS activated while CoS is disabled which is why if you disable CoS, NetBeans automatically disables also DoS

How should I configure that?

So the conclusion here is, you are not doing anything wrong and you can't configure it that way.. NetBeans just don't support such possibility yet. BUT the good thing is I'm currently starting to work on issue 218345 which is exactly what you need. There will be a new check box (already available in Ant Web project) named "Copy static resources on save" that allows you to copy your html/jsp/jsf pages while having DoS disabled.

这篇关于Netbeans部署保存:它应该如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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