无法解析的插件:"org.apache.maven.plugins:maven-jar-plugin:2.4" [英] Unresolved plugin: 'org.apache.maven.plugins:maven-jar-plugin:2.4'

查看:4693
本文介绍了无法解析的插件:"org.apache.maven.plugins:maven-jar-plugin:2.4"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用IntelliJ IDEA创建一个Maven模块后,Maven项目视图中出现了一些问题.当我的光标悬停在Maven项目上时,我看到了:

After I use IntelliJ IDEA to create a maven module, there is some problem in the Maven Projects view. And when my cursor hover on the maven project, i see this:

Project:
cn.itcast.babasport:parent:1.0-SNAPSHOT
Location:
/home/shuaidi/IdeaProjects/parent/pom.xml

Problems:
Unresolved plugin: 'org.apache.maven.plugins:maven-jar-plugin:2.4'

Unresolved plugin: 'org.apache.maven.plugins:maven-compiler-plugin:3.1'

Unresolved plugin: 'org.apache.maven.plugins:maven-surefire-plugin:2.12.4'

Unresolved plugin: 'org.apache.maven.plugins:maven-install-plugin:2.4'

Unresolved plugin: 'org.apache.maven.plugins:maven-site-plugin:3.3'

这是我第一次使用IntelliJ IDEA,所以我用新安装的IDEA和新安装的maven来做这些事情,而我只是创建了一个maven模块而没有做任何其他事情.我不知道为什么出现这些问题. 我只想创建一个Maven模块而没有任何问题.

This is my first time using IntelliJ IDEA, so I do these thing with a new installed IDEA and a new installed maven, and i just create a maven module and didn't do any other thing. I don't know why these problem appearance. I just want to create a maven module without any problem.

ps:

这是我所有的pom文件.

this is all my pom file.

<?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>cn.itcast.babasport</groupId>
    <artifactId>parent</artifactId>
    <version>1.0-SNAPSHOT</version>


</project>

推荐答案

这是

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.

这篇关于无法解析的插件:"org.apache.maven.plugins:maven-jar-plugin:2.4"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆