zoukankan      html  css  js  c++  java
  • faceted project validation builder

    Should I keep Eclipse Java facet?
    Facets automate some parts of project configuration and deployment.For example inform you when servletis not added to web.xml in dynamic web project. Stuff like that.When you add JPA facet, eclipse will create persistence.xml and will keep notifying when you create entity class but don't configure it in persistence file.There's lots more, adding facets to projects also reconfigures how your project structure looks in eclipse.Basically they do exactly as you quoted: " Adds support for writing applications using Java programming language.Every facet add something new so if you want more specific answer you have to answer question about specific facet. If you don't know what they can do for you - turn them off. You can always add them when you learn more.Real life example:Adding JPA facet messed up my project using ObjectDB by creating persistence file, which, turned out, I didn't even need. 
     
     
    I am running Eclipse 3.1 on Mac OS X and everything is going fine. I did a clean & and build for my Struts application and noticed that my class files were not built.
    
    I have the Default output folder defined as:
    
    projectName/WebRoot/WEB-INF/classes but no classes are compiled there. I looked in the Tomcat deploy directory, and despite there being a classes folder, it also is empty. Looking at the project properties I have the following defined (I am guessing myEclipse put there here):
    
    webClasspathBuilder
    J2EEProjectValidator
    DeploymentDescriptorValidator
    Validation
    Strutured Document and Model Builder
    DeploymentBuilder
    Java Builder
    
    All are checked, but selecting Build Project or Build All doesn’t do a thing. I know I was compiling classes earlier, so what happened? The project name in the Package Explorer has a red X on it, as if there is a problem, inspecting the Project Properties doesn’t indicate anything.
    
    November 1, 2005 at 9:07 pm #240622 REPLY
    Profile photo of Riyad Kalla
    Riyad Kalla
    
    Member
    Let’s figure out the problem first, that will cause a build to fail especially if it’s a classpath error. I would suggest first opening up your problems view, and seeing the error is there. If it’s not, click the down arrow in the corner of the problems view and select Filter, then click Select All to turn on the visibility for all errors, hit OK. See any new errors?
    
    If not, then try and restart MyEclipse adding -clean to your command line arguments (or your eclipse.ini file, as I mentioend in my other post), close and reopen your project and Clean it. Did that help?
    
    If you hover over the root node of the project that has the error marker, does the tooltip that popup show any helpful information?
    
    November 1, 2005 at 9:19 pm #240625 REPLY
    Profile photo of David
    David
    
    Member
    Wow, I didn’t even know about that “problems view” is that handy! Anyway, I did that ( could not find an “eclipse.ini” on my hard drive) and a bunch of errors like this appear:
    Severity Description Resource In Folder Location Creation Time
    2 Illegal type of archive for required library: ‘/usr/local/jakarta-struts-1.1/lib/struts-bean.tld’ in project JSI JSI November 1, 2005 8:11:09 PM
    
    Severity Description Resource In Folder Location Creation Time
    2 Illegal type of archive for required library: ‘/usr/local/jakarta-struts-1.1/lib/tiles-config_1_1.dtd’ in project JSI JSI November 1, 2005 8:11:09 PM
    
    So that shows me that I am missing libraries, even tho I have added them to my /project/lib directory. Is that the correct place for them to be deployed ?
    
    November 1, 2005 at 10:28 pm #240639 REPLY
    Profile photo of Riyad Kalla
    Riyad Kalla
    
    Member
    Your libraries should be placed in your WebRoot/WEB-INF/lib directory. Additionally MyEclipse will, by default (unless you turned it off), automatically add all libs in that dir to your build path. If they don’t, you need to do it manually.
    
    When you deploy your project, everything from your WebRoot directory down is deployed out, so if your project relies ona resource, make sure it’s in the appropriate place in there somewhere.
    
    **The default web root dir name is WebRoot, you can change it to whatever you want in the MyEclipse settings under J2EE Project.
  • 相关阅读:
    中国剩余定理(CRT) & 扩展中国剩余定理(ExCRT)总结
    各种求逆元
    A*(A_star)搜索总结
    线段树总结
    C++的STL
    Unable to make the session state request to the session state server处理方法
    判断UserAgent是否来自微信
    VS2010 EntityFramework Database First
    VS2010类似Eclipse文件查找功能-定位到
    Newtonsoft.Json随手记
  • 原文地址:https://www.cnblogs.com/FlyAway2013/p/5587699.html
Copyright © 2011-2022 走看看