gpt4 book ai didi

java - Maven构建错误: Failed to execute goal org. apache.maven.plugins :maven-compiler-plugin:3. 5.1:编译

转载 作者:行者123 更新时间:2023-12-01 17:54:36 27 4
gpt4 key购买 nike

我尝试使用“mvn install”构建我的团队项目并收到以下错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project domain: Compilation failure: Compilation failure:
[ERROR] /D:/Omena/nelson-api/domain/src/main/java/nelson/domain/property/Property.java:[5,36] package javax.validation.constraints does not exist
[ERROR] /D:/Omena/nelson-api/domain/src/main/java/nelson/domain/model/dto/MaintenanceDetails.java:[8,36] package javax.validation.constraints does not exist
[ERROR] /D:/Omena/nelson-api/domain/src/main/java/nelson/domain/property/service/PropertyService.java:[10,24] package javax.validation does not exist
[ERROR] /D:/Omena/nelson-api/domain/src/main/java/nelson/domain/property/Property.java:[15,6] cannot find symbol
[ERROR] symbol: class NotNull
[ERROR] location: class nelson.domain.property.Property
[ERROR] /D:/Omena/nelson-api/domain/src/main/java/nelson/domain/property/Property.java:[16,6] cannot find symbol
[ERROR] symbol: class NotNull
[ERROR] location: class nelson.domain.property.Property
[ERROR] /D:/Omena/nelson-api/domain/src/main/java/nelson/domain/property/Property.java:[17,6] cannot find symbol
[ERROR] symbol: class NotNull
[ERROR] location: class nelson.domain.property.Property
[ERROR] /D:/Omena/nelson-api/domain/src/main/java/nelson/domain/model/dto/MaintenanceDetails.java:[15,6] cannot find symbol
[ERROR] symbol: class NotNull
[ERROR] location: class nelson.domain.model.dto.MaintenanceDetails
[ERROR] /D:/Omena/nelson-api/domain/src/main/java/nelson/domain/model/dto/MaintenanceDetails.java:[16,6] cannot find symbol
[ERROR] symbol: class NotNull
[ERROR] location: class nelson.domain.model.dto.MaintenanceDetails
[ERROR] /D:/Omena/nelson-api/domain/src/main/java/nelson/domain/model/dto/MaintenanceDetails.java:[17,6] cannot find symbol
[ERROR] symbol: class NotNull
[ERROR] location: class nelson.domain.model.dto.MaintenanceDetails
[ERROR] /D:/Omena/nelson-api/domain/src/main/java/nelson/domain/model/dto/MaintenanceDetails.java:[18,6] cannot find symbol
[ERROR] symbol: class NotNull
[ERROR] location: class nelson.domain.model.dto.MaintenanceDetails
[ERROR] /D:/Omena/nelson-api/domain/src/main/java/nelson/domain/property/service/PropertyService.java:[75,23] cannot find symbol

这里是pom.xml文件,我也没有权限更改这个文件

<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>

我用谷歌搜索了很多,但没有运气。由于某种原因,关于这个问题的所有答案都出奇的简短和模糊。

更新1:UTF-8问题已解决(但仍然存在其他错误)

更新2:此处详细介绍Property.java的导入

package nelson.domain.property;    
import java.io.Serializable;
import javax.validation.constraints.NotNull;
import nelson.common.util.Struct;

最佳答案

  • 在 pom.xml-javax.validationvalidation-api:version 中添加此依赖项
  • 如果您已经添加但仍然抛出异常,请右键单击您的项目 -> maven -> 更新项目并选中强制更新。

关于java - Maven构建错误: Failed to execute goal org. apache.maven.plugins :maven-compiler-plugin:3. 5.1:编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46318390/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com