Why does NetBeans recreate “old” packages' folders on deploy?

微笑、不失礼 提交于 2020-01-16 00:52:12

问题


Working with a java web application in NetBeans I've refactored my packages several times. Now when the IDE builds the project, I find empty folders with the names of "old" packages in build\web\WEB-INF\classes\. Saying "old" I mean those packages I have already deleted, moved or renamed.

I've looked through all the files in the application folder, searching for these "old" names, but failed to find any occurance at all. Where does NetBeans take it from?

I should add, that these folders are created on Deploy command, not Build. So probably it's Apache Tomcat...


回答1:


Examining the output window of the IDE, I found that while deploying it used configuration from c:\Users\<current user>\.netbeans\7.0\var\. In this directory I found cache folder and removed it. Also I deleted my project's build folder.

After rebuilding and deploying, IDE created folders for the existing packages only. I do hope that this is it and those old ones were stored in the IDE cache I deleted.

P.S.: before removing the cache folder, one should close the IDE, or it may have problems while closing the open solutions.




回答2:


I have dealt with this before. If clean and build doesn't fix it. I am sure creating a new project and moving all your .form and .java files from SRC into your new projects SRC will fix it.

I am not sure why netbeans does that but it is finicky when editing Package folders because netbeans needs this written down somewhere in its program to compile from CMD Line and all that jazz.



来源:https://stackoverflow.com/questions/17609712/why-does-netbeans-recreate-old-packages-folders-on-deploy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!