This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
1. Create a web project (Tomcat is the target server) 2. Run it => war file is created in the dist directory, even though Tomcat does not need it, as the application is directory deployed. This is a performance issue.
This is because the "Create WAR File" checkbox in the project customizer (Packaging section) is cheched by default when you create a new project. Stepan suggested the following solution: - The "Create WAR File" checkbox will be removed from the project customizer. - Whether or not to produce the war file will be detected automatically by the project, based on whether the target server supports directory deployment. - There will be an action on the popup menu called "Export WAR File" (or similar), that will call the war target, and that the user can use to produce the war.
I understand it is a performance issue but is it a real bug? It is implemented by this way for a few releases and if the proposed solution needs an UI change and introducing a new popup action it seems more like a performance enhancement than a defect. Do we want to do it for 6.0?
I want it for 6.0 :-)
Maybe we shouldn't remove that checkbox completely, it should be just unchecked by default.
Sounds good, but what about servers that do not support directory based deployment? Maybe it should be checked/unchecked at project creation time based on whether the server supports dir.deploy or not.
my comment was probably a bit confusing.. i was commenting only removal of the checkbox not the rest of the solution
*** Issue 103518 has been marked as a duplicate of this issue. ***
Instead of doing all these changes... have we considered changing the order of operations... current order: 1. build the classes 2. create the war file 3. deploy from the build directory... 4. open the browser new order (when directory deploy is supported) 1. build the classes 2. deploy from the build directory... 3. open browser 4. build the war file This solution would depend on issue 103517
I'd go with leaving the checkbox disabled by default. If the target server doesn't support directory deployments, gray the checkbox out. Do this check every time the user selects a different server.
s/disabled by default/unchecked by default/
Created attachment 43537 [details] will this patch help clariify an approack
I think the "pattern" for this patch also applies to ejb, app-client and ear projects.
PP01: This patch doesn't influence the UI. So it means that the patch implicates your suggestion form May 9? From the diff I'm not able to recognized correctly what the patch does. Could you describe it? PP02: In the setDirectoryDeploymentProperty you use string "directory.deployment.supported". It would be better to have it as a static constant. PP03: Use //I18N comments
PP01: The patch implements the following: an additional property is set in the WebActionProvider.java. This property "tells" the build script whether the plugin that will be called by to do the actual deployment supports directory deployment. I replaces the call to dist with a pair of targets that do the packaging, if it is required to do the deploy... dist doesn't include that kind of check... dist makes a war... no matter what. PP02: can do. PP03: will do, where they apply after implementing PP02...
Created attachment 43560 [details] post-review
I'm sorry for the late response. I looked at the new diff properly and it seams to me that there are two problems. PP05: The -post-dist target will not be called. PP06: The checkbox "Create WAR file" will be ingnored if the server has directory deployment capability.
Re: PP05... yup, because the dist is not being called... Re: PP06... yup, but only when the user is not trying to build a war... they are trying to run the project... The Build action will still create the war file. Ok. From the looks of your comments, you think the war file SHOULD BE created when the user selects the: Run File, Run Project and Run Main Project actions on a Web App that will be directory deployed. That is in direct conflict with the initial description of the bug. If we are going to continue wasting the user's time, by building a war file that they did not ask for... can we at least do it AFTER the web app has been directory deployed and the browser has been opened?
Re:Re: PP05 But still there is a comment in the build.xml that user can customize it: -post-dist: called after jar building I think that if you call -pre-dist you should as well call -post-dist Re:Re: PP06 You are right. I'm sorry I didn't notice. PP07: The debug should work in the same way.
PP08: I'm look again at the conditions for early.war.package.with.custom.manifest and early.war.package.without.custom.manifest. It seams that the war file will not be build when a user uncheck Create WAR file and will use a server, which doesn't have directory based deployment. Then the war file will not be created and the run target fails.
Note: I am just trying to help out on this issue. The issue is not assigned to me. I provided a patch to give folks an idea about one solution strategy. Obviously, the module owner will need to evaluate this strategy and may choose to adopt it, adapt it or ignore it... As they see fit. They are responsible for solving the problem. Calling -post-dist: in the run case that may be dangerous for the user, since they are likely to assume that the jar/war file is available in their action.... Maybe we should eliminate the call to -pre-dist... I don't know. PP07: yes. PP08: I will double check that. Are we sure that this doesn't happen already (without applying these changes)?
Regarding to PP08 I think you are true that there is the bug also without applying the patch. I think we should do things properly. If we change a piece of code and the problem is a part of it we should correct it.
Assigning to Tomas M.
Should be fixed this way: - "temporary" WAR file is created if and only if "Create WAR File" is NOT checked (if it's checked the behaviour is unchanged) and directory based deployment is NOT supported - this applies for running as well as for deploying application Thanks Vince for inspiration. Checking in src/org/netbeans/modules/web/project/WebActionProvider.java; /cvs/web/project/src/org/netbeans/modules/web/project/WebActionProvider.java,v <-- WebActionProvider.java new revision: 1.91; previous revision: 1.90 done Checking in src/org/netbeans/modules/web/project/resources/build-impl.xsl; /cvs/web/project/src/org/netbeans/modules/web/project/resources/build-impl.xsl,v <-- build-impl.xsl new revision: 1.143; previous revision: 1.142 done
Default state of "Create WAR file" checkbox changed - it's unchecked now. Checking in src/org/netbeans/modules/web/project/api/WebProjectUtilities.java; /cvs/web/project/src/org/netbeans/modules/web/project/api/WebProjectUtilities.java,v <-- WebProjectUtilities.java new revision: 1.23; previous revision: 1.22 done
Additional fix (thanks Vince). Checking in src/org/netbeans/modules/web/project/resources/build-impl.xsl; /cvs/web/project/src/org/netbeans/modules/web/project/resources/build-impl.xsl,v <-- build-impl.xsl new revision: 1.146; previous revision: 1.145 done
Reverting last change in build-impl.xsl because it doesn't work for JBoss. Run task has to depend on Dist task. Checking in src/org/netbeans/modules/web/project/resources/build-impl.xsl; /cvs/web/project/src/org/netbeans/modules/web/project/resources/build-impl.xsl,v <-- build-impl.xsl new revision: 1.147; previous revision: 1.146 done