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.
  • 相关阅读:
    OCP 062【中文】考试题库(cuug内部资料)第13题
    OCP 062【中文】考试题库(cuug内部资料)第12题
    560. 和为K的子数组 力扣(中等) 字节面试题,不会,前缀和,hash,有尺取法的味道
    863. 二叉树中所有距离为 K 的结点 力扣(中等) bfs
    671. 二叉树中第二小的节点 力扣(简单) auto循环set
    1713. 得到子序列的最少操作次数 力扣(困难) 最长公共子序列->最长上升子序列 lower(vector) 得迭代器
    47. 全排列 II 力扣(中等) 手写练习
    328. 奇偶链表 力扣(中等) 链表练习
    21. 合并两个有序链表 力扣(简单) 链表练习
    1743. 从相邻元素对还原数组 力扣(中等) 需要思考但可以做,hash
  • 原文地址:https://www.cnblogs.com/FlyAway2013/p/5587699.html
Copyright © 2011-2022 走看看