└─$ mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.xiinnn:CTF-Java-Gadget >---------------------
[INFO] Building CTF-Java-Gadget 1.0-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from aliyunmaven-central: https://maven.aliyun.com/repository/central/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.pom
Downloading from aliyunmaven-central: https://maven.aliyun.com/repository/central/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.072 s
[INFO] Finished at: 2024-11-19T08:23:39-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project CTF-Java-Gadget: Could not collect dependencies for project com.xiinnn:CTF-Java-Gadget:jar:1.0-SNAPSHOT
[ERROR] Failed to read artifact descriptor for commons-collections:commons-collections:jar:3.2.1
[ERROR] Caused by: The following artifacts could not be resolved: commons-collections:commons-collections:pom:3.2.1 (absent): Could not transfer artifact commons-collections:commons-collections:pom:3.2.1 from/to aliyunmaven-central (https://maven.aliyun.com/repository/central): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[ERROR] Failed to read artifact descriptor for commons-collections:commons-collections:jar:3.2.2
[ERROR] Caused by: The following artifacts could not be resolved: commons-collections:commons-collections:pom:3.2.2 (absent): Could not transfer artifact commons-collections:commons-collections:pom:3.2.2 from/to aliyunmaven-central (https://maven.aliyun.com/repository/central): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[ERROR]
[ERROR] -> [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
jdk 中的证书。
┌──(kali㉿kali)-[~/…/java-se-8u43-ri/jre/lib/security]
└─$ keytool -list -V -keystore cacerts -storepass changeit | grep aliyun | more
Alias name: aliyun
Owner: CN=*.aliyun.com, O="Alibaba (China) Technology Co., Ltd.", L=HangZhou, ST=ZheJiang, C=CN
DNSName: *.aliyun.com
DNSName: *.aliyun-iot-share.com
DNSName: *.hologres.aliyuncs.com
DNSName: *.yuntu.aliyun.com
DNSName: *.help-ccs.aliyun.com
DNSName: *.app.aliyun.com
DNSName: *.rtc.aliyun.com
DNSName: *.acs-internal.aliyuncs.com
DNSName: *.cn-hangzhou.aliyuncs.com
DNSName: *.tw-gaoxiong.aliyuncs.com
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
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>aliyunmaven-central</id>
<mirrorOf>central</mirrorOf>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/central</url>
</mirror>
<mirror>
<id>repo1</id>
<mirrorOf>central</mirrorOf>
<name>central repo</name>
<url>http://repo1.maven.org/maven2/</url>
</mirror>
<mirror>
<id>aliyunmaven-apache</id>
<mirrorOf>apache snapshots</mirrorOf>
<name>阿里云阿帕奇仓库</name>
<url>https://maven.aliyun.com/repository/apache-snapshots</url>
</mirror>
</mirrors>
</settings>
pom
<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>com.xiinnn</groupId>
<artifactId>CTF-Java-Gadget</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- javassist用于更方便构造类 -->
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.27.0-GA</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.1</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>5.3.24</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.3</version>
</dependency>
<dependency>
<groupId>rome</groupId>
<artifactId>rome</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.80</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.3.24</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
</dependency>
<!-- JTAReadObject2JNDI -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>3.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<mainClass>com.xiinnn.commonly.POJOJackson</mainClass>
<classpathScope>compile</classpathScope>
<additionalClasspathElements>
<additionalClasspathElement>${project.build.sourceDirectory}</additionalClasspathElement>
<additionalClasspathElement>${project.build.outputDirectory}</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
</plugin>
</plugins>
</build>
</project>
改成3.2.2报这个错了
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.xiinnn:CTF-Java-Gadget >---------------------
[INFO] Building CTF-Java-Gadget 1.0-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from aliyunmaven-central: https://maven.aliyun.com/repository/central/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.284 s
[INFO] Finished at: 2024-11-19T08:43:13-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project CTF-Java-Gadget: Could not collect dependencies for project com.xiinnn:CTF-Java-Gadget:jar:1.0-SNAPSHOT
[ERROR] Failed to read artifact descriptor for commons-collections:commons-collections:jar:3.2.2
[ERROR] Caused by: The following artifacts could not be resolved: commons-collections:commons-collections:pom:3.2.2 (absent): Could not transfer artifact commons-collections:commons-collections:pom:3.2.2 from/to aliyunmaven-central (https://maven.aliyun.com/repository/central): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[ERROR]
[ERROR] -> [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
原项目用默认用的3.2.1。不应该报错的
4.4的报错
└─$ mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.xiinnn:CTF-Java-Gadget >---------------------
[INFO] Building CTF-Java-Gadget 1.0-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from aliyunmaven-central: https://maven.aliyun.com/repository/central/org/apache/commons/commons-collections4/4.4/commons-collections4-4.4.pom
Downloading from aliyunmaven-central: https://maven.aliyun.com/repository/central/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.035 s
[INFO] Finished at: 2024-11-19T10:17:12-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project CTF-Java-Gadget: Could not collect dependencies for project com.xiinnn:CTF-Java-Gadget:jar:1.0-SNAPSHOT
[ERROR] Failed to read artifact descriptor for org.apache.commons:commons-collections4:jar:4.4
[ERROR] Caused by: The following artifacts could not be resolved: org.apache.commons:commons-collections4:pom:4.4 (absent): Could not transfer artifact org.apache.commons:commons-collections4:pom:4.4 from/to aliyunmaven-central (https://maven.aliyun.com/repository/central): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[ERROR] Failed to read artifact descriptor for commons-collections:commons-collections:jar:3.2.2
[ERROR] Caused by: The following artifacts could not be resolved: commons-collections:commons-collections:pom:3.2.2 (absent): Could not transfer artifact commons-collections:commons-collections:pom:3.2.2 from/to aliyunmaven-central (https://maven.aliyun.com/repository/central): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[ERROR]
[ERROR] -> [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
你的
settings.xml
都是错的,我就是纯Linux环境开发,没有任何问题,mirror
标签的id
怎么能重复呢参考阿里云云效配置,配置越简单越好