Maven无法解析包含.knm文件的Kotlin库的问题求助及相关疑问
Maven无法解析包含.knm文件的Kotlin库的问题求助及相关疑问
我现在遇到了几个问题,想请教大家的帮助:
前置小疑问
- 第一个问题:什么是
.knm文件?我谷歌搜索了好久,只找到一些关于IDE对.knm文件没有语法高亮的问题讨论,完全没搞懂这个文件的实际用途。 - 第二个小疑问:为什么我用到的这个库包结构是
linkdata.package_dev...这种形式?有点好奇背后的命名逻辑或者设计考量。
核心问题:Maven无法解析指定库
这是我目前最头疼的问题,Maven一直无法解析我需要的库,尝试了各种方法都没解决,具体情况如下:
- 这个库我之前用Gradle构建项目时完全可以正常引入和使用
- 换了该库的不同版本进行测试,结果还是一样无法解析
- 我使用的是刚安装的2024.2版本社区版IDE,执行了
Invalidate Caches / Restart操作也没有任何效果
附上IDE里的报错截图:
我的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"> <modelVersion>4.0.0</modelVersion> <groupId>org.example</groupId> <artifactId>example2</artifactId> <version>1.0-SNAPSHOT</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <kotlin.code.style>official</kotlin.code.style> <kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget> </properties> <repositories> <repository> <id>mavenCentral</id> <url>https://repo1.maven.org/maven2/</url> </repository> <repository> <id>jitpack</id> <url>https://jitpack.io/</url> </repository> </repositories> <build> <sourceDirectory>src/main/kotlin</sourceDirectory> <testSourceDirectory>src/test/kotlin</testSourceDirectory> <plugins> <plugin> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-maven-plugin</artifactId> <version>2.0.10</version> <executions> <execution> <id>compile</id> <phase>compile</phase> <goals> <goal>compile</goal> </goals> </execution> <execution> <id>test-compile</id> <phase>test-compile</phase> <goals> <goal>test-compile</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.22.2</version> </plugin> <plugin> <artifactId>maven-failsafe-plugin</artifactId> <version>2.22.2</version> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.6.0</version> <configuration> <mainClass>MainKt</mainClass> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-stdlib</artifactId> <version>2.0.10</version> </dependency> <dependency> <groupId>com.github.kotlin-telegram-bot</groupId> <artifactId>kotlin-telegram-bot</artifactId> <version>6.2.0</version> </dependency> <dependency> <groupId>dev.inmo</groupId> <artifactId>krontab</artifactId> <version>2.5.0</version> </dependency> <!-- test --> <dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-test-junit5</artifactId> <version>2.0.10</version> <scope>test</scope> </dependency> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter</artifactId> <version>5.10.0</version> <scope>test</scope> </dependency> </dependencies> </project>
备注:内容来源于stack exchange,提问作者Kalich
相关产品推荐
相关产品推荐

