为什么程序/插件不接受 pom.xml 中的依赖项?
我已经在 pom.xml 中包含了 JSON 依赖项,但仍然无法正常工作。
<dependencies>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180130</version>
</dependency>
</dependencies>
JSONObject cannot be resolved to a type
The import org.json cannot be resolved
如何解决这个问题?
最佳答案
插件的运行时类路径完全由其 MANIFEST.MF 文件的内容控制。您可以使用 Maven poms 来设置编译时路径,但您必须在插件 list 中包含运行时所需的所有内容,无论是作为依赖项还是作为插件本身包含的内容。
关于java - 插件开发的 Maven 依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51510426/