首页
关于
归档
赞赏
声明
留言
友链
Search
1
又拍云CDN的正确打开方式
4,997 阅读
2
腾讯2021届秋招校园招聘前端笔试真题(第一次笔试)
4,913 阅读
3
Gradle/Maven配置国内镜像源(以Android Studio为例)
4,879 阅读
4
中国建设银行甘肃省分行2021秋季校招面试经验
4,869 阅读
5
VScode配置C/C++环境
4,864 阅读
杂谈
生活
技术
随笔
登录
Search
标签搜索
windows
github
gitee
Python
镜像
Android Studio
Android
秋招
招聘
宝塔面板
vscode
git
php
服务器
CDN
阿里云
onedrive
oneindex
网盘
C语言
来不及午觉
累计撰写
87
篇文章
累计收到
50
条评论
首页
栏目
杂谈
生活
技术
随笔
页面
关于
归档
赞赏
声明
留言
友链
搜索到
6
篇与
的结果
2020-02-22
IntelliJ IDEA中maven依赖无法下载的解决办法
说明如题,解决办法有三种,请自行尝试。步骤请按照步骤进行方法1 对下图中的两个位置点击刷新按钮 方法2 勾选下图中红框的部分;该菜单路径为:File -> Build, Execution, Deployment -> Build Tools -> Maven -> Importing 方法3 配置国内maven阿里云镜像,地址:IDEA配置阿里云镜像 写在最后一般情况下,这三种方法总能解决maven依赖问题,若还是不行,请自行百度。
2020年02月22日
27 阅读
0 评论
0 点赞
2020-02-19
IntelliJ IDEA配置阿里云maven镜像
说明如题,最近发现家里的网络不知道为什么使用maven特别慢,所以更换国内镜像。步骤1.前往maven官网下载:maven官网 (请下载Binary zip archive版)2.解压maven,并将maven下bin目录添加为环境变量3.打开cmd,输入mvn -v,出现下面内容即环境变量配置成功:Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: D:\tools\apache-maven-3.6.3\bin\.. Java version: 1.8.0_231, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_231\jre Default locale: zh_CN, platform encoding: GBK OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"4.在maven根目录下新建文件夹repo5.修改maven目录下conf/settings.xml文件,修改后的settins.xml内容如下:<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- | This is the configuration file for Maven. It can be specified at two levels: | | 1. User Level. This settings.xml file provides configuration for a single user, | and is normally provided in ${user.home}/.m2/settings.xml. | | NOTE: This location can be overridden with the CLI option: | | -s /path/to/user/settings.xml | | 2. Global Level. This settings.xml file provides configuration for all Maven | users on a machine (assuming they're all using the same Maven | installation). It's normally provided in | ${maven.conf}/settings.xml. | | NOTE: This location can be overridden with the CLI option: | | -gs /path/to/global/settings.xml | | The sections in this sample file are intended to give you a running start at | getting the most out of your Maven installation. Where appropriate, the default | values (values used when the setting is not specified) are provided. | |--> <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"> <!-- localRepository | The path to the local repository maven will use to store artifacts. | | Default: ${user.home}/.m2/repository <localRepository>/path/to/local/repo</localRepository> --> <localRepository>D:\tools\apache-maven-3.6.3\repo</localRepository> <!-- interactiveMode | This will determine whether maven prompts you when it needs input. If set to false, | maven will use a sensible default value, perhaps based on some other setting, for | the parameter in question. | | Default: true <interactiveMode>true</interactiveMode> --> <!-- offline | Determines whether maven should attempt to connect to the network when executing a build. | This will have an effect on artifact downloads, artifact deployment, and others. | | Default: false <offline>false</offline> --> <!-- pluginGroups | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e. | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list. |--> <pluginGroups> <!-- pluginGroup | Specifies a further group identifier to use for plugin lookup. <pluginGroup>com.your.plugins</pluginGroup> --> </pluginGroups> <!-- proxies | This is a list of proxies which can be used on this machine to connect to the network. | Unless otherwise specified (by system property or command-line switch), the first proxy | specification in this list marked as active will be used. |--> <proxies> <!-- proxy | Specification for one proxy, to be used in connecting to the network. | <proxy> <id>optional</id> <active>true</active> <protocol>http</protocol> <username>proxyuser</username> <password>proxypass</password> <host>proxy.host.net</host> <port>80</port> <nonProxyHosts>local.net|some.host.com</nonProxyHosts> </proxy> --> </proxies> <!-- servers | This is a list of authentication profiles, keyed by the server-id used within the system. | Authentication profiles can be used whenever maven must make a connection to a remote server. |--> <servers> <!-- server | Specifies the authentication information to use when connecting to a particular server, identified by | a unique name within the system (referred to by the 'id' attribute below). | | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are | used together. | <server> <id>deploymentRepo</id> <username>repouser</username> <password>repopwd</password> </server> --> <!-- Another sample, using keys to authenticate. <server> <id>siteServer</id> <privateKey>/path/to/private/key</privateKey> <passphrase>optional; leave empty if not used.</passphrase> </server> --> </servers> <!-- mirrors | This is a list of mirrors to be used in downloading artifacts from remote repositories. | | It works like this: a POM may declare a repository to use in resolving certain artifacts. | However, this repository may have problems with heavy traffic at times, so people have mirrored | it to several places. | | That repository definition will have a unique id, so we can create a mirror reference for that | repository, to be used as an alternate download site. The mirror site will be the preferred | server for that repository. |--> <mirrors> <!-- mirror | Specifies a repository mirror site to use instead of a given repository. The repository that | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used | for inheritance and direct lookup purposes, and must be unique across the set of mirrors. | <mirror> <id>mirrorId</id> <mirrorOf>repositoryId</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://my.repository.com/repo/path</url> </mirror> --> <mirror> <id>aliyunmaven</id> <mirrorOf>central</mirrorOf> <name>aliyun</name> <url>https://maven.aliyun.com/repository/public</url> </mirror> </mirrors> <!-- profiles | This is a list of profiles which can be activated in a variety of ways, and which can modify | the build process. Profiles provided in the settings.xml are intended to provide local machine- | specific paths and repository locations which allow the build to work in the local environment. | | For example, if you have an integration testing plugin - like cactus - that needs to know where | your Tomcat instance is installed, you can provide a variable here such that the variable is | dereferenced during the build process to configure the cactus plugin. | | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles | section of this document (settings.xml) - will be discussed later. Another way essentially | relies on the detection of a system property, either matching a particular value for the property, | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'. | Finally, the list of active profiles can be specified directly from the command line. | | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact | repositories, plugin repositories, and free-form properties to be used as configuration | variables for plugins in the POM. | |--> <profiles> <!-- profile | Specifies a set of introductions to the build process, to be activated using one or more of the | mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/> | or the command line, profiles have to have an ID that is unique. | | An encouraged best practice for profile identification is to use a consistent naming convention | for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc. | This will make it more intuitive to understand what the set of introduced profiles is attempting | to accomplish, particularly when you only have a list of profile id's for debug. | | This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo. <profile> <id>jdk-1.4</id> <activation> <jdk>1.4</jdk> </activation> <repositories> <repository> <id>jdk14</id> <name>Repository for JDK 1.4 builds</name> <url>http://www.myhost.com/maven/jdk14</url> <layout>default</layout> <snapshotPolicy>always</snapshotPolicy> </repository> </repositories> </profile> --> <!-- | Here is another profile, activated by the system property 'target-env' with a value of 'dev', | which provides a specific path to the Tomcat instance. To use this, your plugin configuration | might hypothetically look like: | | ... | <plugin> | <groupId>org.myco.myplugins</groupId> | <artifactId>myplugin</artifactId> | | <configuration> | <tomcatLocation>${tomcatPath}</tomcatLocation> | </configuration> | </plugin> | ... | | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to | anything, you could just leave off the <value/> inside the activation-property. | <profile> <id>env-dev</id> <activation> <property> <name>target-env</name> <value>dev</value> </property> </activation> <properties> <tomcatPath>/path/to/tomcat/instance</tomcatPath> </properties> </profile> --> </profiles> <!-- activeProfiles | List of profiles that are active for all builds. | <activeProfiles> <activeProfile>alwaysActiveProfile</activeProfile> <activeProfile>anotherAlwaysActiveProfile</activeProfile> </activeProfiles> --> </settings>注意:第五十五行的localRepository路径为刚刚新建的repo路径6.再次打开cmd,输入mvn help:system,出现如下内容即阿里云镜像配置成功:[INFO] Scanning for projects... Downloading from aliyunmaven: https://maven.aliyun.com/repository/public/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom Downloaded from aliyunmaven: https://maven.aliyun.com/repository/public/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom (3.9 kB at 6.5 kB/s) Downloading from aliyunmaven: https://maven.aliyun.com/repository/public/org/apache/maven/plugins/maven-plugins/22/maven-plugins-22.pom Downloaded from aliyunmaven: https://maven.aliyun.com/repository/public/org/apache/maven/plugins/maven-plugins/22/maven-plugins-22.pom (13 kB at 79 kB/s) Downloading from aliyunmaven: https://maven.aliyun.com/repository/public/org/apache/maven/maven-parent/21/maven-parent-21.pom Downloaded from aliyunmaven: https://maven.aliyun.com/repository/public/org/apache/maven/maven-parent/21/maven-parent-21.pom (26 kB at 156 kB/s) Downloading from aliyunmaven: https://maven.aliyun.com/repository/public/org/apache/apache/10/apache-10.pom注意:Downloaded之后的网址是刚刚配置的阿里云镜像地址即可7.打开IntelliJ IDEA,依次点击File -> Build, Execution, Deployment -> Build Tools -> Maven,修改图中红色框的部分,换成刚刚配置好的本地maven以及配置文件即可。8.修改后先点击apply然后点击OK9.这时,右下角会出现maven的提示,选择import changes即可。提示网上很多教程只修改setting.xml文件,在里面添加mirror,实际上会出现语法错误的提示,并且阿里云镜像也没生效。经本人测试,必须要配置localRepository才不会出现语法错误。
2020年02月19日
3,715 阅读
0 评论
0 点赞
2020-02-02
Python pip 更换镜像源
说明有时候网不好,pip安装非常慢,所以需要更换源,特记录如下步骤国内镜像地址:# 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple # 豆瓣 https://pypi.douban.com/simple/ # 阿里云 https://mirrors.aliyun.com/pypi/simple/ # 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ # 华中理工大学 https://pypi.hustunique.com/ # 山东理工大学 https://pypi.sdutlinux.org/本文从临时使用和永久使用分别介绍临时使用使用pip时,加上参数-i https://mirrors.aliyun.com/pypi/simple/即可例如pip install pyspider -i https://mirrors.aliyun.com/pypi/simple/这样就从阿里云镜像站安装pyspider永久使用Windows和Linux配置不同,分别介绍Windows系统直接在用户目录下新建pip文件夹,然后在此文件夹内新建文件pip.ini,内容如下:[global] index-url = https://mirrors.aliyun.com/pypi/simple/ [install] trusted-host = mirrors.aliyun.com注意:用户目录路径为C:\Users\xxxx\(xxx是计算机用户名)Linux系统修改用户目录下的.pip文件夹内的pip.conf文件(若没有则新建.pip/pip.conf),文件内容和上面Windows系统一致。Linux下完整文件路径为~/.pip/pip.conf
2020年02月02日
1,290 阅读
0 评论
0 点赞
2019-10-18
Gradle/Maven配置国内镜像源(以Android Studio为例)
说明Gradle源在国外,国内构建项目的时候经常报错连接超时,修改国内镜像可以解决。方法配置方式有仅对单个项目生效和对所有项目生效两种方式对单个项目生效1.打开Android Studio工程文件,找到build.gradle2.使用文本编辑器打开,默认格式如下:// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.5.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } 3.修改为以下内容:// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'https://maven.aliyun.com/repository/jcenter' } } dependencies { classpath 'com.android.tools.build:gradle:3.5.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'https://maven.aliyun.com/repository/jcenter' } } } task clean(type: Delete) { delete rootProject.buildDir } 对所有项目生效1.打开系统用户的Gradle配置目录:C:\Users\xxx\.gradle2.新建文件init.gradle(注意文件后缀名为gradle)allprojects{ repositories { def ALIYUN_REPOSITORY_URL = 'https://maven.aliyun.com/repository/public' def ALIYUN_JCENTER_URL = 'https://maven.aliyun.com/repository/jcenter' all { ArtifactRepository repo -> if (repo instanceof MavenArtifactRepository){ def url = repo.url.toString() if (url.startsWith('https://repo1.maven.org/maven2')) { project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_REPOSITORY_URL." remove repo } if (url.startsWith('https://jcenter.bintray.com/')) { project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_JCENTER_URL." remove repo } } } maven { url ALIYUN_REPOSITORY_URL url ALIYUN_JCENTER_URL } } }
2019年10月18日
4,879 阅读
0 评论
0 点赞
2019-10-17
Android Studio设置国内镜像源
说明没有科学上网工具,国内无法很好的访问Android资源,特记录国内镜像配置过程。步骤1.打开Android Studio,点击左下角的configure,选择SDK manager,在左侧的菜单中选择HTTP Proxy或者在工程界面,依次点击File->Settings->Appearance & behavior->System settings->HTTP Proxy也可2.在上述红色区域内填写下列国内镜像地址:(任选其一即可)# 电子科技大学 mirrors.dormforce.net 端口:80 # 南阳理工学院镜像服务器地址: mirror.nyist.edu.cn 端口:80 # 中国科学院开源协会镜像站地址: IPV4/IPV6: mirrors.opencas.cn 端口:80 IPV4/IPV6: mirrors.opencas.org 端口:80 IPV4/IPV6: mirrors.opencas.ac.cn 端口:80 # 上海GDG镜像服务器地址: sdk.gdgshanghai.com 端口:8000 # 北京化工大学镜像服务器地址: IPv4: ubuntu.buct.edu.cn 端口:80 IPv4: ubuntu.buct.cn 端口:80 IPv6: ubuntu.buct6.edu.cn 端口:80 # 大连东软信息学院镜像服务器地址: mirrors.neusoft.edu.cn 端口:80 # 郑州大学开源镜像站: mirrors.zzu.edu.cn 端口:80 # 腾讯Bugly镜像: android-mirror.bugly.qq.com 端口:80803.填写好之后点击Apply即可
2019年10月17日
3,153 阅读
0 评论
0 点赞
1
2