Java Maven无法解析Kotlin Maven插件jar
我不知道如何解决这个问题 我想要的是Kotlin运行时和 以下是my pom.xml中的位:Java Maven无法解析Kotlin Maven插件jar,java,maven,Java,Maven,我不知道如何解决这个问题 我想要的是Kotlin运行时和 以下是my pom.xml中的位: <dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-runtime</artifactId> <version>1.2-M2</version> </depen
<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>
我将此添加为回购:
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>kotlin-bintray</id>
<name>Kotlin Bintray</name>
<url>http://dl.bintray.com/kotlin/kotlin-dev/</url>
</repository>
我得到这个错误:
找不到
kotlin:kotlin maven插件:jar:1.2-M2 in
缓存在本地
在更新之前,不会重新尝试解析
中心时间间隔已过或更新已停止
强迫的
但我看不出有什么不对的地方
顺便说一句,请注意,运行时jar已经找到,所以repository部分必须是正确的,因为这个存储库是maven找到它的地方。maven插件jar是一个不同的问题,但出于某种原因…为了确保它从maven central下载新鲜的插件,您需要清除本地副本,所以请删除目录 ~/.m2/repo/org/jetbrains/kotlin/kotlin maven插件 您还需要将第三方回购协议添加到位于~/.m2的settings.xml中
为了确保它能从maven central下载到最新版本,您需要删除本地副本,因此请删除该目录 ~/.m2/repo/org/jetbrains/kotlin/kotlin maven插件 您还需要将第三方回购协议添加到位于~/.m2的settings.xml中
我刚修好。这是一件非常愚蠢的事情。我发现插件需要定义一个插件存储库部分
<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:我刚修好。这是一件非常愚蠢的事情。我发现插件需要定义一个插件存储库部分
<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:最后,我们可以看看如何实现编译器插件
对于kotlin allopen,在标记中添加以下内容
最后,我们可以看到如何实现编译器插件
对于kotlin allopen,在标记中添加以下内容
仅供参考,这个jar似乎在maven central中,不需要存储库部分-@DanW它不在那里,甚至有一条评论指出回购isI在哪里需要这个特定版本,即使maven central中存在其他版本仅供参考,似乎这个jar在maven central中不需要存储库部分-@DanW它不在那里,甚至有一条评论指出repo isI需要这个特定版本,即使maven centralOK中存在其他版本,我没有看到它在第三方repo中,我已经更新了我的答案,即使你现在已经修复了它。好的,我没有看到它是在第三方回购协议中,我已经更新了我的答案,即使你现在已经修复了它。
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<configuration>
<compilerPlugins>
<!-- Or "spring" for the Spring support -->
<plugin>all-open</plugin>
</compilerPlugins>
<pluginOptions>
<!-- Each annotation is placed on its own line -->
<option>all-open:annotation=com.my.Annotation</option>
<option>all-open:annotation=com.their.AnotherAnnotation</option>
</pluginOptions>
</configuration>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-allopen</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
</plugin>