Maven not able to resolve dependencies after update to intellij 2021.3
javastruct:pom:0.1 failed to transfer from http://0.0.0.0/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of maven-default-http-blocker has elapsed or updates are forced.
2021.3 IDE version has updated the version of the bundled Maven to 3.8.1
. In this version, Maven blocks the access to http
repositories by default. Before that, Maven itself has moved from using the http repositories.
So now one needs to explicitly configure Maven to allow http
repositories if they are used in the project. E.g. in settings.xml
add a mirror to your http repository that allows HTTP:
<mirrors> <mirror> <id>my-repo-mirror</id> <name>My Repo HTTP Mirror</name> <url>http://url-to.my/repo</url> <mirrorOf>my-repo</mirrorOf> </mirror> </mirrors>
推荐这些文章:
2022.4.17 记录---Springboot-Maven个人通用pom文件
查看代码
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4....
1、pom.xml文件添加distributionManagement节点
<!-- 使用分发管理将本项目打成jar包,直接上传到指定服务器(私服) -->
<distributionManagement>
<!--正式版本-->
<repository>
<!-- setting.xml中配置私服用户名和密码 -->
<id>nexus-releases</id>
<name>Release Repository</name...
1、添加阿里云镜像
1 <mirror>
2 <id>alimaven</id>
3 <mirrorOf>central</mirrorOf>
4 <name>aliyun maven</name>
5 <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
6 </mirror>
&nbs...
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4...
在settings.xml文件中的mirrors下添加mirror标签
<!-- 阿里云仓库 -->
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>...
1-新增 MAVEN_HOME
D:\resource\apache-maven-3.6.3
2-在再配置 Path
末尾添加 ;%MAVEN_HOME%\bin
3-测试
cmd mvn -v
4-修改 conf/settings.xml 文件
a-本地jar下载的位置路径
<localRepository>D:\resource\apache-maven-3.6.3\repository</localRepository>
b-mave...
1. 配置阿里云仓库
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
2. 编写maven配置
<p...
解决:Plugin 'org.apache.maven.plugins:maven-resources-plugin:' not found
加入下面的配置就可以了
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</dependency>
...
Xml配置
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_4...
离线开发前 maven项目先执行下
mvn dependency:go-offline
将所有的依赖全部下载到本地 将代码和本地仓库拷贝到离线环境并在离线环境的setting.xml里配置
true
elipse配置idea配置
idea配置
附setting.xml
<?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"
x...
文章链接:https://www.dianjilingqu.com/51295.html
本文章来源于网络,版权归原作者所有,如果本站文章侵犯了您的权益,请联系我们删除,联系邮箱:saisai#email.cn,感谢支持理解。