maven项目,提示One or more constraints have not been satisfied
生活随笔
收集整理的這篇文章主要介紹了
maven项目,提示One or more constraints have not been satisfied
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
環境
問題現象
顯示錯誤:One or more constraints have not been satisfied.
錯誤Type:Maven Java EE Configuration Problem.
解決辦法
需要檢查一下地方的jdk版本是否合適。
步驟1:在pom中配置JDK版本
<profiles><profile><id>jdk-1.8</id><activation><activeByDefault>true</activeByDefault><jdk>1.8</jdk></activation><properties><maven.compiler.source>1.8</maven.compiler.source><maven.compiler.target>1.8</maven.compiler.target><maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion></properties></profile></profiles>步驟2:在POM.xml文件中,指定wetversion為2.0
<plugin><!--在buil.plugins節點下增加此節點--><groupId>org.apache.maven.plugins</groupId><artifactId>maven-eclipse-plugin</artifactId><version>2.9</version><configuration><wtpversion>2.0</wtpversion><wtpContextName>test</wtpContextName><!--影響context root--></configuration></plugin>步驟3:web.xml文件中web-app版本為2.5以上
web-app 2.5
web-app 3.0
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://java.sun.com/xml/ns/javaeehttp://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"version="3.0">... </web-app>總結
以上是生活随笔為你收集整理的maven项目,提示One or more constraints have not been satisfied的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 矫正完为什么要保持器
- 下一篇: Eclipse中java文件编码格式修改