maven 经常有些jar下不了的解决方法

来源:互联网 发布:js span disabled 编辑:程序博客网 时间:2024/05/01 00:28

1、直接找到需要的jar下载到本地,然后安装到maven
打开CMD,进入到H:\test(下载的jar目录)目录,然后执行下面命令:
mvn install:install-file
-DgroupId=nl.justobjects
-DartifactId=pushlet
-Dversion=2.0.4
-Dpackaging=jar
-DgeneratePom=true
-Dfile=pushlet-2.0.4.jar
其中我们需要知道官方的groupId、artifactId、version
这里写图片描述

这里写图片描述
这里写图片描述
2
settings.xml添加 如下 内容 访问 开源中国的jar 下载源

<mirror><id>CN</id><name>OSChina Central</name> <url>http://maven.oschina.NET/content/groups/public/</url><mirrorOf>central</mirrorOf></mirror><?xml version="1.0" encoding="UTF-8"?><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>alimaven</id>            <mirrorOf>central</mirrorOf>            <name>aliyun maven</name>            <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>        </mirror>        <!-- 中央仓库1 -->        <mirror>            <id>repo1</id>            <mirrorOf>central</mirrorOf>            <name>Human Readable Name for this Mirror.</name>            <url>http://repo1.maven.org/maven2/</url>        </mirror>        <!-- 中央仓库2 -->        <mirror>            <id>repo2</id>            <mirrorOf>central</mirrorOf>            <name>Human Readable Name for this Mirror.</name>            <url>http://repo2.maven.org/maven2/</url>        </mirror>    </mirrors> </settings>
阅读全文
0 0
原创粉丝点击