解决eclipse+MAVEN提示One or more constraints have not been satisfied.的问题

转自:https://www.cnblogs.com/huige-you/p/4195174.html

应用版本:eclipse luna4.4.1

JDK:1.8

Maven:3.2.5

问题现象:

1、编译工程后总该是显示下面两个错误:

  One or more constraints have not been satisfied.

      Deployment Assembly跟java版本不匹配

解决方案:

在pom.xml中添加下面内容即可,同时也可以解决Maven->update project默认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>

原文地址:https://www.cnblogs.com/wei1/p/9582097.html