Plugin ‘org.apache.maven.plugins_maven-compiler-plugin_‘ not found

Plugin ‘org.apache.maven.plugins:maven-compiler-plugin:‘ not found How old are you? 怎么老是你!!!

  • 吾日三省吾身
    • 今天学习了没有?
    • 答曰:自然,可途中偏偏遇到拦路虎,苦老夫久矣。
    • 今日必定将这坑踩个透彻,踏个通透

Maven编译报错

  1. 在使用maven的方式创建SpringBoot项目的时候,编译的时候报错
Plugin ‘org.apache.maven.plugins:maven-compiler-plugin:‘ not found
  • 真的是非常影响正常的学习进度,一怒之下,将该问题研究通透并记录

报错原因以及解决办法

  • 报错的原因非常直白,就是这个插件没有找到
  • 第一反应自然是maven settings.xml 文件的配置是不是出问题了
    • 这里首先确定自己本地路径是否存在settings.xml文件
    • 如果不存在,则创建一个
    • 本着极简为主的原则,配置应当 越简单越好
    • 如下----配置一个镜像源即可,简单明了,如果需要多个,增加 即可
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

	<localRepository>这里填写本地仓库路径</localRepository>
  <mirrors>

        <mirror>
              <id>alimaven</id>
              <name>aliyun maven</name>
              <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
              <mirrorOf>central</mirrorOf>        
    		</mirror>
  </mirrors>
 
</settings>
  • 确定settings.xml配置完成之后,开始刷新下载插件

image.png

  • 这个时候,有可能还继续报错,代码爆红,然后注意下面这个操作
    • 在依赖中添加插件依赖

image.png

  • 注意版本,有时候版本信息不填写也有可能导致插件下载不下来。
  • 到这里一般都能够正常下载了
  • 如果还不能正常运行
    • 那么去自己本地仓库路径,给仓库所在文件夹赋权chmod 777 xxx
  • 什么?有可能还不能正常编译???
    • 检查基础配置
    • image.png
    • 这几个地方点一点,看看都是否配置正确了。
  • 如果还报错?不太可能吧?
    • 再报错有可能是超级低级问题了,是否个别字母写错了?
    • 多了一个空格?

仅记录分享

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
This error message suggests that the Maven compiler plugin is not installed or cannot be found in your local Maven repository or remote repository. To resolve this issue, you can try the following steps: 1. Check if the plugin is specified in your project's pom.xml file. Ensure that the plugin is correctly configured and its version is specified. 2. Check if your Maven settings.xml file is correctly configured to access the remote repository where the plugin is hosted. Ensure that the repository URL, authentication credentials, and proxy settings are correct. 3. Try to manually install the plugin to your local repository by running the following command in your project directory: `mvn install:install-file -Dfile=<path-to-plugin-jar> -DgroupId=<plugin-groupId> -DartifactId=<plugin-artifactId> -Dversion=<plugin-version> -Dpackaging=<plugin-packaging>` Replace the placeholders with the actual values for the plugin you want to install. 4. If the plugin is not hosted in any remote repository, you can include the plugin jar file in your project's lib directory and add the following configuration to your pom.xml file: ``` <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>${compiler.plugin.version}</version> <configuration> <compilerArguments> <endorseddirs>${endorsed.dir}</endorseddirs> </compilerArguments> </configuration> <dependencies> <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>${tools.jar.version}</version> <scope>system</scope> <systemPath>${java.home}/../lib/tools.jar</systemPath> </dependency> </dependencies> </plugin> </plugins> </build> ``` Replace the placeholders with the actual values for the plugin version and the tools.jar version.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值