不知道如何解决这个问题。
这些是我的 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>
Run Code Online (Sandbox Code Playgroud)
我将其添加为回购:
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>kotlin-bintray</id>
<name>Kotlin Bintray</name>
<url>http://dl.bintray.com/kotlin/kotlin-dev/</url>
</repository>
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
在https://repo.maven.apache.org/maven2中找不到 org.jetbrains.kotlin:kotlin-maven-plugin:jar:1.2-M2 的失败 被缓存在本地存储库中,直到更新间隔才会重新尝试解析中央已过期或强制更新
但我没有看到任何可能是错误的。
顺便说一句,请注意运行时 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>
Run Code Online (Sandbox Code Playgroud)
现在它起作用了。我想我应该花更多时间深入学习 maven :)