java - intellij maven 使用 localRepository 配置为插件“org.apache.maven.plugins:maven-compiler-plugin”提供错误解析版本
问题描述
我想使用 localRepository 而不是使用默认的 .m2 和默认值settings.xml
,所以我设置了 settings.xml 调用它my_settings.xml
,在 intellij 中我这样调用它:
clean -s my_settings.xml install -f pom.xml
my_settings.xml 安装如下所示:
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<localRepository>c:/Dev/my/java/dispatcherApp/local</localRepository>
<activeProfiles>
<activeProfile>defaultMainProfile</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>defaultMainProfile</id>
<pluginRepositories>
<pluginRepository>
<id>maven-central</id>
<name>maven-central</name>
<url>http://repo1.maven.org/maven2/</url>
</pluginRepository>
<pluginRepository>
<id>sonatype</id>
<name>sonatype</name>
<url>http://oss.sonatype.org/content/repositories/releases/</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
但是在执行它时我得到:
[ERROR] Error resolving version for plugin 'org.apache.maven.plugins:maven-compiler-plugin' from the repositories [local (c:\Dev\my\java\dispatcherApp\local), maven-central (http://repo1.maven.org/maven2/), sonatype (http://oss.sonatype.org/content/repositories/releases/), central (https://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository -> [Help 1]
我需要下载 AWS SDK,在 pom.xml 模块中我有:
<?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">
<parent>
<artifactId>dispatcherApp</artifactId>
<groupId>com.dispatcherApp</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>aws-manager</artifactId>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
</dependency>
</dependencies>
</project>
解决方案
推荐阅读
- spring-boot - Spring Boot 应用程序在 Kafka 消费者重新平衡时停止服务流量
- visual-studio-code - ESLint 不格式化
- python - 如何在scip中获取非零变量列表
- android - 如何将二维数组复制到 Kotlin 中的 RenderScript 分配
- kubernetes - 如何为 Kubernetes 中的特定部署禁用 istio-proxy sidecar 访问日志
- testing - Webdriver 规范中的“键输入状态”是什么意思?
- linux - 无法从 http-> https 重定向,错误::80:绑定:权限被拒绝
- flutter - 如何解决flutter中的listview问题
- java - Docker Tomcat - java.lang.StackOverflowError
- python - 如何在 ARM64 系统上从 UVC 设备获取 MJPG 格式的视频帧?(与蟒蛇)