java - IDEA开发环境下maven如何管理java项目的依赖下载
问题描述
我在 IDEA 编码。当我使用maven时,我遇到了一个奇怪的问题。
首先IDEA配置了本地maven环境,使用本地配置文件setting.xml
,配置了nexus节点。
其次,我从 eclipse 中导入了一个基于 maven 的项目。
我确信setting.xml
100% 正确。但是IDEA不是从nexus下载jar,而是从maven url下载。
我不知道发生了什么。
我清理~\m2
文件夹,清理'lib' floder。但它也没有成功。
想知道IDEA如何使用maven下载jar,如何确定url,什么情况下会下载失败。
https://www.jetbrains.com/help/idea/settings-build-execution-deployment.html
我隐藏了 groupId、artifactId、name 和密码,但我确定它是正确的。
我隐藏了一些依赖,它太多了。
父 Pom 处于关联中。
<?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"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>D:\Software\maven\repo</localRepository>
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
<server>
<id>nexus</id>
<username>name</username>
<password>pwd</password>
</server>
<server>
<id>y-snapshots</id>
<username>name</username>
<password>pwd</password>
</server>
<server>
<id>y-releases</id>
<username>name</username>
<password>pwd</password>
</server>
</servers>
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://192.168.31.169:8081/repository/maven-public/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
<?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.0.0</modelVersion>
<parent>
<groupId>com.s</groupId>
<artifactId>ss</artifactId>
<version>1.4.0-SNAPSHOT</version>
</parent>
<artifactId>s-common</artifactId>
<version>1.5.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
</dependencies>
</project>
解决方案
推荐阅读
- azure - 将数据从 DB2 加载到 Azure SQL DB
- bash - 试图了解 Bash 文件设置/结构
- html - Angular 服务器端渲染 - 向 angular.json 添加什么?
- oracle - 尝试从 selenium 连接到 oracle DB 时出错
- swift - 从函数 Swift 获取通用类型 UIView
- c# - PDFLib set_graphics_option如何在fillcolor选项中传递颜色列表
- snowflake-cloud-data-platform - Snowflake 中具有两种不同时间戳格式的 CSV 文件
- visual-studio-code - 如何修复颜色更改节点终端(2019 年 10 月更新后的 Visual Studio Code)?
- c++ - 使用本机插件在 Unity3D 中将 YUV 转换为 RGB 的更好方法
- dynamics-crm - PowerApps Portal--> 创建记录后(插入表单)将该记录显示为编辑表单