gpt4 book ai didi

java - Maven 无法解析 Kotlin Maven Plugin jar

转载 作者:行者123 更新时间:2023-11-29 08:33:27 29 4
gpt4 key购买 nike

不确定如何解决这个问题。

我要this version Kotlin 运行时和 maven plugin .

这些是我的 pom.xml 中的位:

    <dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-runtime</artifactId>
<version>1.2-M2</version>
</dependency>

<build>
<plugins>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>1.2-M2</version>
<executions>

然后我将其添加为 repo 协议(protocol):

    <repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>kotlin-bintray</id>
<name>Kotlin Bintray</name>
<url>http://dl.bintray.com/kotlin/kotlin-dev/</url>
</repository>

我收到这个错误:

Failure to find org.jetbrains.kotlin:kotlin-maven-plugin:jar:1.2-M2 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced

但我没有看到任何可能出错的地方。

顺便说一下,注意找到了运行时 jar,所以存储库部分必须是正确的,因为这个存储库是 Maven 找到它的地方。出于某种原因,maven 插件 jar 是另一回事......

最佳答案

我刚刚修好了。这真的很愚蠢。我发现对于插件,需要定义一个插件存储库部分。

<pluginRepositories>
<pluginRepository>
<id>kotlin-bintray</id>
<name>Kotlin Bintray</name>
<url>http://dl.bintray.com/kotlin/kotlin-dev</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

现在可以了。我想我应该花更多时间深入学习 maven :)

关于java - Maven 无法解析 Kotlin Maven Plugin jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45964826/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com