无法解析项目的依赖关系:primefaces 和 modelmapper
Could not resolve dependencies for project: primefaces and modelmapper
我尝试在另一台计算机上导入我的项目,但是当我尝试使用 maven 构建项目时,出现这些错误。
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.247 s
[INFO] Finished at: 2022-02-20T10:27:33-06:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project serpienteemplumada: Could not resolve dependencies for project com.serpienteemplumada:serpienteemplumada:war:0.0.1-SNAPSHOT: The following artifacts could not be resolved: org.primefaces:primefaces:jar:10.0.0, org.primefaces.extensions:primefaces-extensions:jar:10.0.2, org.modelmapper:modelmapper:jar:2.3.5: Could not transfer artifact org.primefaces:primefaces:jar:10.0.0 from/to spring-plugins (https://repo.spring.io/plugins-release/): Access denied to https://repo.spring.io/plugins-release/org/primefaces/primefaces/10.0.0/primefaces-10.0.0.jar. Error code 401, Unauthorized -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
网上找到的方法我都试过了,maven:clean,更新安装;将存储库放在开头,从另一个 IDE 开始工作,但是,错误仍然存在于这两个依赖项中。
这是我的 Pom.xml 文件
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.serpienteemplumada</groupId>
<artifactId>serpienteemplumada</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>serpienteemplumada</name>
<description>MarketPlace Serpiente Emplumada</description>
<properties>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<start-class>com.SerpienteemplumadaApplication</start-class>
</properties>
<repositories>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
<repository>
<id>spring-plugins</id>
<name>Spring Plugins Repository</name>
<url>https://repo.spring.io/plugins-release/</url>
<layout>default</layout>
</repository>
<repository>
<id>central</id>
<name>central</name>
<url>http://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>ICM</id>
<name>ICM</name>
<url>http://maven.icm.edu.pl/artifactory/repo/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.primefaces/primefaces -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>10.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.primefaces.extensions/primefaces-extensions -->
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
<version>10.0.2</version>
</dependency>
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>all-themes</artifactId>
<version>1.0.10</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.2.20</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.2.20</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>2.0.SP1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
<version>2.3.5</version>
</dependency>
<dependency>
<groupId>org.imgscalr</groupId>
<artifactId>imgscalr-lib</artifactId>
<version>4.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
感谢阅读。
我终于可以...
我不得不阅读那些有冲突的项目的依赖关系,然后我手动下载,出于一个奇怪的原因我的项目无法访问 PrimeFace 存储库
如果 org.primefaces.themes 失败,我就从这里下载这些文件:
https://search.maven.org/search?q=g:org.primefaces
然后我不得不加入我的 maven2 文件夹
/用户/$用户/.m2/repository/org
此外,我更改了依赖项的版本。
我尝试在另一台计算机上导入我的项目,但是当我尝试使用 maven 构建项目时,出现这些错误。
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.247 s
[INFO] Finished at: 2022-02-20T10:27:33-06:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project serpienteemplumada: Could not resolve dependencies for project com.serpienteemplumada:serpienteemplumada:war:0.0.1-SNAPSHOT: The following artifacts could not be resolved: org.primefaces:primefaces:jar:10.0.0, org.primefaces.extensions:primefaces-extensions:jar:10.0.2, org.modelmapper:modelmapper:jar:2.3.5: Could not transfer artifact org.primefaces:primefaces:jar:10.0.0 from/to spring-plugins (https://repo.spring.io/plugins-release/): Access denied to https://repo.spring.io/plugins-release/org/primefaces/primefaces/10.0.0/primefaces-10.0.0.jar. Error code 401, Unauthorized -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
网上找到的方法我都试过了,maven:clean,更新安装;将存储库放在开头,从另一个 IDE 开始工作,但是,错误仍然存在于这两个依赖项中。
这是我的 Pom.xml 文件
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.serpienteemplumada</groupId>
<artifactId>serpienteemplumada</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>serpienteemplumada</name>
<description>MarketPlace Serpiente Emplumada</description>
<properties>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<start-class>com.SerpienteemplumadaApplication</start-class>
</properties>
<repositories>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
<repository>
<id>spring-plugins</id>
<name>Spring Plugins Repository</name>
<url>https://repo.spring.io/plugins-release/</url>
<layout>default</layout>
</repository>
<repository>
<id>central</id>
<name>central</name>
<url>http://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>ICM</id>
<name>ICM</name>
<url>http://maven.icm.edu.pl/artifactory/repo/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.primefaces/primefaces -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>10.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.primefaces.extensions/primefaces-extensions -->
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
<version>10.0.2</version>
</dependency>
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>all-themes</artifactId>
<version>1.0.10</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.2.20</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.2.20</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>2.0.SP1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
<version>2.3.5</version>
</dependency>
<dependency>
<groupId>org.imgscalr</groupId>
<artifactId>imgscalr-lib</artifactId>
<version>4.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
感谢阅读。
我终于可以...
我不得不阅读那些有冲突的项目的依赖关系,然后我手动下载,出于一个奇怪的原因我的项目无法访问 PrimeFace 存储库
如果 org.primefaces.themes 失败,我就从这里下载这些文件:
https://search.maven.org/search?q=g:org.primefaces
然后我不得不加入我的 maven2 文件夹
/用户/$用户/.m2/repository/org
此外,我更改了依赖项的版本。