简体   繁体   English

Eclipse Faces Config编辑器不起作用

[英]Eclipse Faces Config Editor not working

Summary 摘要

The Faces Config Editor in Eclipse does not open when editing faces-config.xml. 编辑faces-config.xml时,Eclipse中的Faces Config Editor无法打开。 This is in a JavaServer Faces project. 这在JavaServer Faces项目中。

Details 细节

Eclipse 3.7.2 Eclipse 3.7.2

Eclipse m2e 1.0.1 Eclipse m2e 1.0.1

m2e-wtp plugin 0.15 m2e-wtp插件0.15

I've seen this question already ( How to activate Faces configuration editor in Eclipse? ), but when I add the Faces facet to my project it no longer compiles. 我已经看到了这个问题( 如何在Eclipse中激活Faces配置编辑器? ),但是当我将Faces facet添加到项目中时,它将不再编译。 Probably because I imported a Maven project, rather than using the Eclipse WTP project creation wizard. 可能是因为我导入了Maven项目,而不是使用Eclipse WTP项目创建向导。 I have the Maven directory structure (which I prefer, and do not wish to change). 我有Maven目录结构(我更喜欢,并且不想更改)。

The problem is, when I open faces-config.xml from within this project the Faces Config Editor doesn't start, so I have to edit it using plain XML. 问题是,当我从该项目中打开faces-config.xml时,Faces Config编辑器无法启动,因此我必须使用纯XML对其进行编辑。 That's not the worst thing in the world... but if there's a solution I'd like to know about it. 这不是世界上最糟糕的事情……但是,如果有解决方案,我想知道。

Thanks! 谢谢! Alex 亚历克斯

EDIT 编辑

As no one is answering this, maybe I need to provide more information. 由于没有人回答,也许我需要提供更多信息。

Faces Config Editor does work when: 在以下情况下,Faces Config Editor 可以工作:

  • creating Dynamic Web Project using project creation wizard 使用项目创建向导创建动态Web项目
  • importing existing Maven project, then adding the JSF Facet (but in this case the project no longer compiles, because Eclipse can't find the Maven dependencies) 导入现有的Maven项目,然后添加JSF Facet(但是在这种情况下,该项目不再编译,因为Eclipse无法找到Maven依赖项)

Faces Config Editor does not work when: 在以下情况下,Faces Config Editor 不起作用

  • importing existing Maven project, if I don't add the JSF Facet 如果不添加JSF Facet,则导入现有的Maven项目

I realize that one option is to: 我意识到一种选择是:

  1. import an existing Maven project 导入现有的Maven项目
  2. add the JSF Facet 添加JSF Facet
  3. add Maven to Deployment Assembly 将Maven添加到Deployment Assembly

But the problem with this solution is every time I Update Project Configuration (from Maven) Maven needs to be added to the Deployment Assembly again ( Eclipse + Maven + Dynamic Web Project -> Maven overwrites Deployment Assembly ). 但是此解决方案的问题是,每当我从Maven更新项目配置时,都需要再次将Maven添加到Deployment Assembly( Eclipse + Maven +动态Web项目-> Maven覆盖Deployment Assembly )。 This is why I use the m2e-wtp Eclipse plugin. 这就是为什么我使用m2e-wtp Eclipse插件。 It allows me to use the default Maven project structure, with Eclipse, and get rid of the unnecessary "magic". 它使我可以在Eclipse中使用默认的Maven项目结构,并摆脱不必要的“魔术”。

My only problem is this Faces Config Editor thing. 我唯一的问题是Faces Config Editor。

Sorry for the verbosity 抱歉,冗长

SOLUTION

it was a dumb mistake and a simple fix. 这是一个愚蠢的错误,而且很简单。 when adding the JavaServer Faces facet to my project because it broke the build, this was just because Eclipse tried to add JSF (MyFaces) to my build path, and I already had MyFaces via Maven, which resulted in a conflict. 当因为它破坏了构建而将JavaServer Faces facet添加到我的项目中时,这仅仅是因为Eclipse试图将JSF(MyFaces)添加到我的构建路径中,并且我已经通过Maven获得了MyFaces,这导致了冲突。 The solution was dead simple, keep the JavaServer Faces facet enabled and remove the Eclipse-added JSF library from my build path. 该解决方案非常简单,请保持启用JavaServer Faces构面,并从构建路径中删除Eclipse添加的JSF库。

When adding the JavaServer Faces facet to the project, it breaks the build, because Eclipse tries to add JSF (MyFaces) libraries to the build path, and these already existed via Maven dependencies, resulting in name conflicts. JavaServer Faces facet添加到项目时,它会中断构建,因为Eclipse尝试将JSF (MyFaces)库添加到构建路径,并且这些库已经通过Maven依赖项存在,从而导致名称冲突。

Solution : Enable the JavaServer Faces facet (to activate Faces Config Editor ), and remove the Eclipse-added JSF libraries from the build path. 解决方案 :启用JavaServer Faces facet (以激活Faces Config Editor ),并从构建路径中删除Eclipse添加的JSF库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM