zoukankan      html  css  js  c++  java
  • maven与sbt修改国内镜像

    一、idea中的maven

    1.打开IntelliJ IDEA->Settings ->Build, Execution, Deployment -> Build Tools > Maven

    一个是本地配置文件的位置,另一个是本地仓库的位置

    在.m2下面新建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>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>

    二、sbt

    1.在`~/.sbt/`下添加一个`repositories`文件,里面内容如下:

    [repositories]
    local
    aliyun: http://maven.aliyun.com/nexus/content/groups/public/
    typesafe: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
    sonatype-oss-releases
    maven-central
    sonatype-oss-snapshots

    2.自定义下载位置,在sbtconfsbtconfig.txt中末尾添加

    -Dsbt.boot.directory=~/sbt-0.13.15/boot
    -Dsbt.global.base=~/sbt-0.13.15/.sbt
    -Dsbt.ivy.home=~/sbt-0.13.15/.ivy2

    3.sbt配置表

    4.idea里的sbt

     5.如果只是在单个项目中修改的话,在build.sbt里添加

    resolvers += "aliyun" at "http://maven.aliyun.com/nexus/content/groups/public/"
  • 相关阅读:
    纯html的table打印注意事项
    Silverlight:针式打印机文字模糊的改善办法
    C#执行XSL转换
    tomcat 新手上路
    跨浏览器的剪贴板访问解决方案
    打印机设置(PrintDialog)、页面设置(PageSetupDialog) 及 RDLC报表如何选择指定打印机
    利用ActiveX实现web页面设置本地默认打印机、纸张大小
    前端工程化的理解
    算法注意---3、分治的本质
    算法与数据结构---4.9、最大子段和-dp空间优化
  • 原文地址:https://www.cnblogs.com/feiyumo/p/9237517.html
Copyright © 2011-2022 走看看