maven-proxy不支持url重定向

本文介绍了一个MavenProxy不支持URL重定向的问题及解决方案。作者使用的MavenProxy版本无法从http://www.ibiblio.org/maven2/下载资源,通过修改URL为http://mirrors.ibiblio.org/pub/mirrors/maven2/成功解决了问题。
一直在公司内用一个maven proxy。最近发现我用的这个版本不支持url重定向。
配置中,remote服务器:http://www.ibiblio.org/maven2/,并用浏览器测试该url有效。但是proxy却不能下载。
将配置改成http://mirrors.ibiblio.org/pub/mirrors/maven2/即可。
E:\Java\jdk-21\bin\java.exe -Dmaven.multiModuleProjectDirectory=E:\sync\sycn -Djansi.passthrough=true -Dmaven.home=C:\Users\asus\.m2\wrapper\dists\apache-maven-3.9.11-bin\6mqf5t809d9geo83kj4ttckcbc\apache-maven-3.9.11 -Dclassworlds.conf=C:\Users\asus\.m2\wrapper\dists\apache-maven-3.9.11-bin\6mqf5t809d9geo83kj4ttckcbc\apache-maven-3.9.11\bin\m2.conf "-Dmaven.ext.class.path=E:\idea2025\IntelliJ IDEA 2025.1\plugins\maven\lib\maven-event-listener.jar" "-javaagent:E:\idea2025\IntelliJ IDEA 2025.1\lib\idea_rt.jar=57022" -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath C:\Users\asus\.m2\wrapper\dists\apache-maven-3.9.11-bin\6mqf5t809d9geo83kj4ttckcbc\apache-maven-3.9.11\boot\plexus-classworlds-2.9.0.jar;C:\Users\asus\.m2\wrapper\dists\apache-maven-3.9.11-bin\6mqf5t809d9geo83kj4ttckcbc\apache-maven-3.9.11\boot\plexus-classworlds.license org.codehaus.classworlds.Launcher -Didea.version=2025.1 install [INFO] Scanning for projects... [INFO] [INFO] --------------------------< com.example:sycn >-------------------------- [INFO] Building sycn 0.0.1-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- resources:3.3.1:resources (default-resources) @ sycn --- [INFO] Copying 1 resource from src\main\resources to target\classes [INFO] Copying 0 resource from src\main\resources to target\classes [INFO] [INFO] --- compiler:3.14.0:compile (default-compile) @ sycn --- [INFO] Recompiling the module because of changed source code. [INFO] Compiling 7 source files with javac [debug parameters release 21] to target\classes [INFO] 由于在类路径中发现了一个或多个处理程序,因此启用了 批注处理。未来发行版的 javac 可能会禁用批注处理, 除非至少按名称指定了一个处理程序 (-processor), 或指定了搜索路径 (--processor-path, --processor-module-path), 或显式启用了批注处理 (-proc:only, -proc:full)。 可使用 -Xlint:-options 隐藏此消息。 可使用 -proc:none 禁用批注处理。 [INFO] [INFO] --- resources:3.3.1:testResources (default-testResources) @ sycn --- [INFO] skip non existing resourceDirectory E:\sync\sycn\src\test\resources [INFO] [INFO] --- compiler:3.14.0:testCompile (default-testCompile) @ sycn --- [INFO] Recompiling the module because of changed dependency. [INFO] Compiling 1 source file with javac [debug parameters release 21] to target\test-classes [INFO] 由于在类路径中发现了一个或多个处理程序,因此启用了 批注处理。未来发行版的 javac 可能会禁用批注处理, 除非至少按名称指定了一个处理程序 (-processor), 或指定了搜索路径 (--processor-path, --processor-module-path), 或显式启用了批注处理 (-proc:only, -proc:full)。 可使用 -Xlint:-options 隐藏此消息。 可使用 -proc:none 禁用批注处理。 [INFO] [INFO] --- surefire:3.5.3:test (default-test) @ sycn --- [INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider Downloading from central: https://repo.maven.apache.org/maven2/org/junit/platform/junit-platform-engine/1.12.1/junit-platform-engine-1.12.1.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 15.353 s [INFO] Finished at: 2025-09-11T09:09:56+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.3:test (default-test) on project sycn: The following artifacts could not be resolved: org.junit.platform:junit-platform-engine:jar:1.12.1 (absent): Could not transfer artifact org.junit.platform:junit-platform-engine:jar:1.12.1 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.108.215] failed: Connect timed out -> [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/MojoExecutionException 进程已结束,退出代码为 1
09-12
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值