One or more constraints have not been satisfied.

错误说明:eclipse+maven下java Resoures资源文件夹出现小红叉。

错误提示内容:One or more constraints have not been satisfied.


错误原因: Deployment Assembly跟java版本不匹配,即maven默认编译版本与使用的jdk不匹配。


解决方案:在pom中配置如下内容:

<!-- 指定maven编译方式为jdk1.7版本 -->
<profiles>
	<profile>
		<id>jdk-1.7</id>
		<activation>
			<activeByDefault>true</activeByDefault>
			<jdk>1.7</jdk>
		</activation>
		<properties>
			<maven.compiler.source>1.7</maven.compiler.source>
			<maven.compiler.target>1.7</maven.compiler.target>
			<maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
		</properties>
	</profile>
</profiles>


配置好以后,重新maven update Project...下就行了。



  • 21
    点赞
  • 30
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
javax.validation.constraints.NotEmpty是一个用于验证字段不为空的约束注解。它可以应用于String、Collection、Map和数组等类型的字段上。被@NotEmpty注解修饰的字段不能为null且不能为空。\[3\]在引用\[2\]中的示例中,@NotEmpty(message = "ID不能为空")应用于List<String>类型的userIds字段,表示该字段不能为null且不能为空。因此,在创建的类对象中,如果userIds字段为null或者为空集合,就会出现"执行报错:No validator could be found for constraint 'javax.validation.constraints.NotEmpty' validating type 'java.lang.Long'. Check configuration for 'id'"的错误提示。\[1\] #### 引用[.reference_title] - *1* [No validator could be found for constraint ‘javax.validation.constraints.NotEmpty‘...报错解决](https://blog.csdn.net/qq_40816795/article/details/127109993)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [validation校验包常用校验注解@NotEmpty,@NotBlank,@NotNull等注解](https://blog.csdn.net/Ying_ph/article/details/125908693)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [javax.validation.constraints中@NotEmpty,@NotNull,@NotBlank的区别](https://blog.csdn.net/m0_51176516/article/details/117456403)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值