matthiasblaesing opened a new issue, #8138: URL: https://github.com/apache/netbeans/issues/8138
### Discussed in https://github.com/apache/netbeans/discussions/8121 ### Apache NetBeans version Apache NetBeans 24 ### What happened A new unwanted directory is appearing in the build directory and so being included in the .war file /build/web/WEB-INF/classesa/NetbeansProjects/jaffa/build/web/javascript/[various files here] The folder contains files that are generated and written to the web directory during the build. If I subsequently edit files in under the web directory of the project they start to appear in the classesa directory with additional directory tree structure ### Language / Project Type / NetBeans Component java ant web application project ### How to reproduce - Click add new project - Select Category Java with Ant/Java Web/Web Application - Do a clean and build and then review the contents of `build/web/WEB-INF/` - you will see there is a `classes` directory but no `classesa` directory. -Make an edit to the `index.html`, save, and then review the contents of `build/web/WEB-INF/` - you will see there is now a `classesa` directory created with subdirectories that ultimately contain a copy of the `index.html` file. When files under the web directory are subsequently modified the classesa directory gets added to with the jsp files I have edited. ### Did this work correctly in an earlier version? Yes ### Analysis The issue was originally reported as issue #8119 which was converted to a discussion under the assumption, that this was a misunderstanding of the correct project structure. In the discussion the steps to reproduce above were added. And with these the issue is reproducible (a slightly different name prefix was observed, but the problem is identical). Debugging ultimately leads to `enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/DeployOnSaveManager.java` and its `distributeOnSave` method. For any change that method is triggered and this code is executed: https://github.com/apache/netbeans/blob/56b833249d36c0dd4c1dc920f3ab19c6f5de7a10/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/DeployOnSaveManager.java#L623-L631 The value of `filePath` in line 628 is `/tmp/WebApplication1/build/web/index.html`, the value of `classes` from line 627 is `target/classes`. Now in line 629 `filePath.indexOf` is called and will yield `-1` (not found). This case is not handled. The assumptions here are wrong and cause this issue. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
