我正在关注gs-rest-service示例,并通过查看其他一些教程向POM添加了一些内容,但是当我发出mvn clean package
时,每次出现错误都会失败
无法在org.springframework.boot上收集依赖项:spring-boot-starter-web:jar:2.0.0.RELEASE - > org.hibernate.validator:休眠-验证:罐:6.0.7.Final
我也尝试在pom中更改Spring版本,但是它给出了相同的结果,只是在错误跟踪中提到了不同版本的hibernate验证器。
我附加了错误消息,我的pom.xml文件和settings.xml。
这里是完整的错误消息:
[错误]无法在项目gs-rest-service上执行目标:无法解析项目org.springframework的依赖项:gs-rest-service:war:0.1.0:无法在org.springframework.boot中收集依赖项:spring-boot-starter-web:jar:2.0.2.RELEASE - > org.hibernate.validator:hibernate-validator:jar:6.0.9.Final:无法读取org.hibernate.validator的工件描述符:hibernate-validator:jar:6.0.9.Final:无法传输工件org.jboss。 shrinkwrap:shrinkwrap-bom:pom:1.2.3 from / to spring-releases(https://repo.spring.io/libs-release):sun.security.validator.ValidatorException:PKIX路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到所请求目标的有效证书路径 - > [帮助1] [错误] [错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。 [ERROR]使用-X开关重新运行Maven以启用完整的调试日志记录。 [错误] [错误]有关错误和可能解决方案的更多信息,请阅读以下文章: [错误] [帮助1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
这是我的pom.xml文件:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework</groupId>
<artifactId>gs-rest-service</artifactId>
<version>0.1.0</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.RELEASE</version>
</parent>
<properties>
<start-class>hello.Application</start-class>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<skip>true</skip>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.release</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle
Releases</name>
<url>http://repository.springsource.com/maven/bundles/release</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.external</id>
<name>SpringSource Enterprise Bundle Repository - External Bundle
Releases</name>
<url>http://repository.springsource.com/maven/bundles/external</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>
</project>
这是我在.m2
中的settings.xml<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>securecentral</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>securecentral</id>
<!--Override the repository (and pluginRepository) "central" from the
Maven Super POM -->
<repositories>
<repository>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<proxies>
<proxy>
<id>proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.tcs.com</host>
<port>8080</port>
<username>1357345</username>
<password>Asus@nexus787</password>
<nonProxyHosts></nonProxyHosts>
</proxy>
<proxy>
<id>proxyhttps</id>
<active>true</active>
<protocol>https</protocol>
<host>proxy.tcs.com</host>
<port>8080</port>
<username>1357345</username>
<password>Asus@nexus787</password>
<nonProxyHosts></nonProxyHosts>
</proxy>
</proxies>
</settings>
我有什么遗失的东西吗? 我从互联网上尝试了很多解决方案,但没有一个能够奏效。 请帮忙!