Java Maven 配置问题一个或多个约束没有得到满足

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23785946/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 01:12:37  来源:igfitidea点击:

Maven configuration issue one or more constraints have not been satisfied

javamavenjsf

提问by JustinBieber

Got the following error while trying to build our common code.

尝试构建我们的公共代码时出现以下错误。

Description Resource Path Location Type JavaServer Faces 2.0 can not be installed : One or more constraints have not been satisfied. Apps line 1 Maven Java EE Configuration Problem JavaServer Faces 2.0 requires Dynamic Web Module 2.5 or newer. Apps line 1 Maven Java EE Configuration Problem

Description Resource Path Location Type JavaServer Faces 2.0 can not be installed : One or more constraints have not been satisfied. Apps line 1 Maven Java EE Configuration Problem JavaServer Faces 2.0 requires Dynamic Web Module 2.5 or newer. Apps line 1 Maven Java EE Configuration Problem

I tried to find the error inside the code but there is no error. I suspect it's a dependency that is missing. Could someone please explain further if my thoughts are correct?

我试图在代码中找到错误,但没有错误。我怀疑这是缺少的依赖项。如果我的想法正确,有人可以进一步解释吗?

回答by Pawe? Wyrwiński

Somewhere in your project there is a web.xmldescriptor, and it declares version number for compliance with some edition of servlet-api. Your application tries to use JSF2 which requires web.xmlto declare version 2.5 or newer. Apparently yours is too old.

项目中的某个地方有一个web.xml描述符,它声明版本号以符合某些版本的 servlet-api。您的应用程序尝试使用需要web.xml声明 2.5 或更新版本的JSF2 。显然你的太老了。

Find this file and check what's there in the root element <web-app>. There are examples of this descriptor for version 2.5 and 3 here on SO: link1, link2, link3.

找到这个文件并检查根元素中的内容<web-app>。在 SO 上有 2.5 版和 3 版的此描述符的示例:link1link2link3