且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法解析的插件:"org.apache.maven.plugins:maven-jar-plugin:2.4"

更新时间:2021-12-30 16:57:51

这是

This is a duplicate of Maven plugins can not be found in IntelliJ. The top answers there did not work for me, so I'll describe what I did.

我只是将所需的插件放入了我的~/.m2/repository中.有两种方法可以实现这一目标.可以使用mvn dependency:get手动下载文件,也可以(我偏爱的方式)使插件成为pom.xml的依赖项,并构建该项目.

I just put the needed plugins into my ~/.m2/repository. There are two ways that achieve that. Either download the files manually with mvn dependency:get, or (my preferred way) make the plugins a dependency in some (whichever) pom.xml and build that project.

<dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-install-plugin</artifactId>
    <version>2.4</version>
    <type>maven-plugin</type>
</dependency>

<dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-deploy-plugin</artifactId>
    <version>2.7</version>
    <type>maven-plugin</type>
</dependency>

现在您可以删除依赖项.然后在Intellij中单击重新导入所有Maven项目"(蓝色圆形箭头图标).

Now you can remove the dependencies. Then click "Reimport all Maven Projects" in Intellij (the blue circular arrows icon).

这个问题似乎完全没有害处,但是曲折的线条令人发指,所以我很高兴能够摆脱它们.

This issue seems completely harmless, but the squiggly lines are kind of infuriating, so I am glad I was able to get rid of them.