解决[ERROR] [ERROR] Some problems were encountered while processing the POMs

在执行mvn -Dmaven.test.skip=true的时候报错:

[ERROR] [ERROR] Some problems were encountered while processing the POMs:[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 54, column 15[ERROR] Unresolveable build extension: Plugin com.github.maven-nar:nar-maven-plugin:3.5.0 or one of its dependencies could not be resolved: The following artifacts could not be resolved: com.github.maven-nar:nar-maven-plugin:jar:3.5.0, org.codehaus.plexus:plexus-utils:jar:1.1: **Could not find artifact com.github.maven-nar:nar-maven-plugin:jar:3.5.0 in ibiblio (http://mirrors.ibiblio.org/maven2/)** @[ERROR] Unknown packaging: nar @ line 9, column 14 @[ERROR] The build could not read 1 project -> [Help 1][ERROR][ERROR]   The project edu.hit.ir.ltp4j:ltp4j:0.1.0-SNAPSHOT (D:\Experiences\ltp4j-master\ltp4j-master\pom.xml) has 2 errors[ERROR]     Unresolveable build extension: Plugin com.github.maven-nar:nar-maven-plugin:3.5.0 or one of its dependencies could not be resolved: The following artifacts could not be resolved: com.github.maven-nar:nar-maven-plugin:jar:3.5.0, org.codehaus.plexus:plexus-utils:jar:1.1: Could not find artifact com.github.maven-nar:nar-maven-plugin:jar:3.5.0 in ibiblio (http://mirrors.ibiblio.org/maven2/) -> [Help 2][ERROR]     Unknown packaging: nar @ line 9, column 14[ERROR][ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.[ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR][ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginManagerException

解决方法:

我之前安装maven时修改了默认的中央仓库镜像,在settings.xml文件中加入了

     <mirror>
       <id>ibiblio</id>
       <mirrorOf>central</mirrorOf>
       <name>Human Readable Name for this Mirror.</name>
       <url>http://mirrors.ibiblio.org/maven2/</url>
     </mirror>

后来借鉴这篇博客,把上面加的文本都删掉,改成了阿里云的中央仓库,也就是用如下文本替代上面的文本。

        <!-- 阿里云仓库 -->
        <mirror>
            <id>alimaven</id>
            <mirrorOf>central</mirrorOf>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
        </mirror>
    
        <!-- 中央仓库1 -->
        <mirror>
            <id>repo1</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo1.maven.org/maven2/</url>
        </mirror>
    
        <!-- 中央仓库2 -->
        <mirror>
            <id>repo2</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo2.maven.org/maven2/</url>
        </mirror> 

解决问题。

你可能感兴趣的:(问题,maven)