美文网首页
2018-12-08 win10系统maven环境搭建

2018-12-08 win10系统maven环境搭建

作者: 2d6b5ee3a71c | 来源:发表于2018-12-08 11:09 被阅读0次

1.下载maven的zip包,官网下载地址:
https://maven.apache.org/download.cgi
2.将zip包解压到开发环境目录:
如D:/devtools1.8/maven3.5.4
3.找到解压目录的/conf/settings.xml文件,打开,增加如下配置:

<localRepository>D:/devtools1.8/maven/repository</localRepository>
<mirrors>
        <mirror>
          <id>alimaven</id>
          <name>aliyun maven</name>
          <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
          <mirrorOf>central</mirrorOf>        
        </mirror>
        <mirror>
            <id>UK</id>
            <mirrorOf>central</mirrorOf>
            <url>http://uk.maven.org/maven2</url>
        </mirror>
        <mirror>
            <id>net-cn</id>
            <mirrorOf>central</mirrorOf>
            <url>http://maven.net.cn/content/groups/public/</url>
        </mirror>
        <mirror>
            <id>osc</id>
            <mirrorOf>central</mirrorOf>
            <url>http://maven.oschina.net/content/groups/public/</url>
        </mirror>
        <mirror>
            <id>osc_thirdparty</id>
            <mirrorOf>thirdparty</mirrorOf>
            <url>http://maven.oschina.net/content/repositories/thirdparty/</url>
        </mirror>
    </mirrors>

    <profiles>
        <profile>
            <id>osc</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <repositories>
                <repository>
                    <id>osc</id>
                    <url>http://maven.oschina.net/content/groups/public/</url>
                </repository>
                <repository>
                    <id>osc_thirdparty</id>
                    <url>http://maven.oschina.net/content/repositories/thirdparty/</url>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>osc</id>
                    <url>http://maven.oschina.net/content/groups/public/</url>
                </pluginRepository>
            </pluginRepositories>
        </profile>
        <profile>
            <id>net-cn</id>
            <repositories>
                <repository>
                    <id>net-cn</id>
                    <url>http://maven.net.cn/content/groups/public/</url>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>net-cn</id>
                    <url>http://maven.net.cn/content/groups/public/</url>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>

4.eclipse引入maven,打开“window--Perferences”,找到“Maven--Installations”,引入上面下载的maven:


maven1.png

5.eclipse确认maven的settings.xml引用和仓库地址配置是否正确:


maven2.png

2018-12-08

相关文章

网友评论

      本文标题:2018-12-08 win10系统maven环境搭建

      本文链接:https://www.haomeiwen.com/subject/eytqhqtx.html