{"id":1715,"date":"2020-08-05T10:38:52","date_gmt":"2020-08-05T02:38:52","guid":{"rendered":"http:\/\/bloo.heing.fun\/?p=1715"},"modified":"2021-03-09T13:18:52","modified_gmt":"2021-03-09T05:18:52","slug":"%e8%bf%90%e7%bb%b4","status":"publish","type":"post","link":"https:\/\/bloo.heing.fun\/?p=1715","title":{"rendered":"\u8fd0\u7ef4"},"content":{"rendered":"\n<ol class=\"wp-block-list\"><li>maven\u6362\u955c\u50cf\u3001\u6362\u4e2d\u592e\u4ed3\u5e93<\/li><\/ol>\n\n\n\n<p>vim ~\/.m2\/settings.xml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> &lt;settings xmlns=\"http:\/\/maven.apache.org\/SETTINGS\/1.0.0\"\n      xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n      xsi:schemaLocation=\"http:\/\/maven.apache.org\/SETTINGS\/1.0.0\n                          https:\/\/maven.apache.org\/xsd\/settings-1.0.0.xsd\">\n      &lt;mirrors>\n        &lt;mirror>\n\t\t&lt;id>alimaven&lt;\/id>\n\t\t&lt;name>aliyun maven&lt;\/name>\n\t\t&lt;url>http:\/\/maven.aliyun.com\/nexus\/content\/groups\/public\/&lt;\/url>\n\t\t&lt;mirrorOf>central&lt;\/mirrorOf>\n\t&lt;\/mirror>\n      &lt;\/mirrors>\n      &lt;repositories>\n        &lt;repository>\n\n        &lt;id>alimaven&lt;\/id>\n        &lt;name>aliyun maven&lt;\/name>\n        &lt;url>http:\/\/maven.aliyun.com\/nexus\/content\/groups\/public\/&lt;\/url>\n        &lt;\/repository>\n      &lt;\/repositories>\n    &lt;\/settings>\n\n\u6216\u8005\uff1a\n&lt;settings xmlns=\"http:\/\/maven.apache.org\/SETTINGS\/1.0.0\"\n  xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n  xsi:schemaLocation=\"http:\/\/maven.apache.org\/SETTINGS\/1.0.0\n                      http:\/\/maven.apache.org\/xsd\/settings-1.0.0.xsd\">\n  &lt;localRepository\/>\n  &lt;interactiveMode\/>\n  &lt;usePluginRegistry\/>\n  &lt;offline\/>\n  &lt;pluginGroups\/>\n  &lt;servers\/>\n  &lt;mirrors>\n    &lt;mirror>\n     &lt;id>aliyunmaven&lt;\/id>\n     &lt;mirrorOf>central&lt;\/mirrorOf>\n     &lt;name>\u963f\u91cc\u4e91\u516c\u5171\u4ed3\u5e93&lt;\/name>\n     &lt;url>https:\/\/maven.aliyun.com\/repository\/central&lt;\/url>\n    &lt;\/mirror>\n    &lt;mirror>\n      &lt;id>repo1&lt;\/id>\n      &lt;mirrorOf>central&lt;\/mirrorOf>\n      &lt;name>central repo&lt;\/name>\n      &lt;url>http:\/\/repo1.maven.org\/maven2\/&lt;\/url>\n    &lt;\/mirror>\n    &lt;mirror>\n     &lt;id>aliyunmaven&lt;\/id>\n     &lt;mirrorOf>apache snapshots&lt;\/mirrorOf>\n     &lt;name>\u963f\u91cc\u4e91\u963f\u5e15\u5947\u4ed3\u5e93&lt;\/name>\n     &lt;url>https:\/\/maven.aliyun.com\/repository\/apache-snapshots&lt;\/url>\n    &lt;\/mirror>\n  &lt;\/mirrors>\n  &lt;proxies\/>\n  &lt;activeProfiles\/>\n  &lt;profiles>\n    &lt;profile>  \n        &lt;repositories>\n           &lt;repository>\n                &lt;id>aliyunmaven&lt;\/id>\n                &lt;name>aliyunmaven&lt;\/name>\n                &lt;url>https:\/\/maven.aliyun.com\/repository\/public&lt;\/url>\n                &lt;layout>default&lt;\/layout>\n                &lt;releases>\n                        &lt;enabled>true&lt;\/enabled>\n                &lt;\/releases>\n                &lt;snapshots>\n                        &lt;enabled>true&lt;\/enabled>\n                &lt;\/snapshots>\n            &lt;\/repository>\n            &lt;repository>\n                &lt;id>MavenCentral&lt;\/id>\n                &lt;url>http:\/\/repo1.maven.org\/maven2\/&lt;\/url>\n            &lt;\/repository>\n            &lt;repository>\n                &lt;id>aliyunmavenApache&lt;\/id>\n                &lt;url>https:\/\/maven.aliyun.com\/repository\/apache-snapshots&lt;\/url>\n            &lt;\/repository>\n        &lt;\/repositories>             \n     &lt;\/profile>\n  &lt;\/profiles>\n&lt;\/settings><\/code><\/pre>\n\n\n\n<p>2. docker\u6362\u6e90<\/p>\n\n\n\n<p>vim \/etc\/docker\/daemon.json&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"registry-mirrors\": &#91;\"https:\/\/docker.mirrors.ustc.edu.cn\", \"http:\/\/hub-mirror.c.163.com\"\uff0c\"https:\/\/registry.docker-cn.com\"]\n}\n<\/code><\/pre>\n\n\n\n<p>3. gradle\u6362\u6e90<\/p>\n\n\n\n<p>nano ~\/.gradle\/init.gradle<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>allprojects{\n    repositories {\n        def ALIYUN_REPOSITORY_URL = 'https:\/\/maven.aliyun.com\/repository\/public\/'\n        def ALIYUN_JCENTER_URL = 'https:\/\/maven.aliyun.com\/repository\/jcenter\/'\n        def ALIYUN_GOOGLE_URL = 'https:\/\/maven.aliyun.com\/repository\/google\/'\n        def ALIYUN_GRADLE_PLUGIN_URL = 'https:\/\/maven.aliyun.com\/repository\/gradle-plugin\/'\n        all { ArtifactRepository repo ->\n            if(repo instanceof MavenArtifactRepository){\n                def url = repo.url.toString()\n                if (url.startsWith('https:\/\/repo1.maven.org\/maven2\/')) {\n                    project.logger.lifecycle \"Repository ${repo.url} replaced by $ALIYUN_REPOSITORY_URL.\"\n                    remove repo\n                }\n                if (url.startsWith('https:\/\/jcenter.bintray.com\/')) {\n                    project.logger.lifecycle \"Repository ${repo.url} replaced by $ALIYUN_JCENTER_URL.\"\n                    remove repo\n                }\n                if (url.startsWith('https:\/\/dl.google.com\/dl\/android\/maven2\/')) {\n                    project.logger.lifecycle \"Repository ${repo.url} replaced by $ALIYUN_GOOGLE_URL.\"\n                    remove repo\n                }\n                if (url.startsWith('https:\/\/plugins.gradle.org\/m2\/')) {\n                    project.logger.lifecycle \"Repository ${repo.url} replaced by $ALIYUN_GRADLE_PLUGIN_URL.\"\n                    remove repo\n                }\n            }\n        }\n        maven { url ALIYUN_REPOSITORY_URL }\n        maven { url ALIYUN_JCENTER_URL }\n        maven { url ALIYUN_GOOGLE_URL }\n        maven { url ALIYUN_GRADLE_PLUGIN_URL }\n    }\n}<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>maven\u6362\u955c\u50cf\u3001\u6362\u4e2d\u592e\u4ed3\u5e93 vim ~\/.m2\/settings.xml 2. docker\u6362\u6e90 vim \/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36,84],"tags":[],"class_list":["post-1715","post","type-post","status-publish","format-standard","hentry","category-36","category-84"],"_links":{"self":[{"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/posts\/1715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1715"}],"version-history":[{"count":8,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/posts\/1715\/revisions"}],"predecessor-version":[{"id":1769,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/posts\/1715\/revisions\/1769"}],"wp:attachment":[{"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}