解决maven中某些依赖无法下载,手动安装Maven依赖


<!--先下载jar包,然后在仓库中手动安装,下面是遇到的两个例子-->
<!--第一个-->
mvn install:install-file -Dfile=D:\kaptcha-2.3.jar -DgroupId=com.google.code.kaptcha -DartifactId=kaptcha -Dversion=2.3 -Dpackaging=jar -DgeneratePom=true
<!--第二个-->
mvn install:install-file -Dfile=D:\fastdfs-client-java-1.27-RELEASE.jar -DgroupId=org.csource -DartifactId=fastdfs-client-java -Dversion=1.27-RELEASE -Dpackaging=jar -DgeneratePom=true

这样做如果还是遇到依赖无法下载,需要检查一下maven的配置文件,conf下的setting.xml文件中是否设置了代理。代理需要设置正确。

<proxies>
    <proxy>
        <id>optional</id>
        <active>true</active>
        <protocol>http</protocol>
        <username></username>
        <password></password>
        <host>你的域名</host>
        <port>你的端口</port>
        <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
</proxies>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM