GVKun编程网logo

Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (htt

25

在本文中,我们将为您详细介绍Couldnottransferartifactorg.apache.maven.plugins:maven-clean-plugin:pom:2.5from/tocent

在本文中,我们将为您详细介绍Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (htt的相关知识,此外,我们还会提供一些关于build.plugins.plugin.version'' for org.apache.maven.plugins:maven-compiler-pl、clipse加载maven工程提示pom.xml无法解析org.apache.maven.plugins:maven-resources-plugin:、Could not calculate build plan: Plugin org.apache.maven.plugins:maven-war-plugin:2.1.1 or one of、Could not calculate build plan: Plugin org.apache.maven.plugins:maven-war-plugin:2.2的有用信息。

本文目录一览:

Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (htt

Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (htt

一.问题

Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Transfer Failed for https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom

二.解决方案  

     1.更改idea中的证书:

        证书错误,访问https协议的网站,需要ssl认证才行,这里没有证书,我们可以用下面的方式忽略ssl检查导致的问题。
        我们可以到IEDA->setting里,去找 Maven,在importing里加入如下的语句:

         

-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true

 

总结

以上是小编为你收集整理的Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (htt全部内容。

如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。

原文地址:https://www.cnblogs.com/dwh-horse/p/16367817.html

build.plugins.plugin.version'' for org.apache.maven.plugins:maven-compiler-pl

build.plugins.plugin.version'' for org.apache.maven.plugins:maven-compiler-pl

字面意思就是没有指定版本信息 ,警告问题:程序可以运行

增加一行 

<version>2.3.2</version>  用来指定版本信息

 

 <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>  
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>

 

 

OK了

 

Using platform encoding (UTF-8 actually) to copy filtered resources

虽然并不影响项目的正常运行和install,但是不想看到这警告的发生。

加上(可加在在结尾处)

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

如下:

 <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>  
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>
    

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

 

 

clipse加载maven工程提示pom.xml无法解析org.apache.maven.plugins:maven-resources-plugin:

clipse加载maven工程提示pom.xml无法解析org.apache.maven.plugins:maven-resources-plugin:

在别的机子上创建一个maven工程,复制到本机上导入,出现pom.xml文件错误,提示错误如下:

报错信息代码
  1. Multiple annotations found at this line:  
  2. - Execution default-testResources of goal org.apache.maven.plugins:maven-resources-          plugin:2.4.3:testResources failed:  
  3.  Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect  
  4.  dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-  
  5.  plugin:2.4.3:testResources:default-testResources:process-test-resources)  
  6. - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile  
  7.  (execution: default-compile, phase: compile)  
  8. - CoreException: Could not get the value for parameter compilerId for plugin execution default-compile:  
  9.  PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be  
  10.  resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2 ():  
  11.  ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven:maven-plugin-api:jar:2.0.6:  
  12.  ArtifactResolutionException: Failure to transfer org.apache.maven:maven-plugin-api:pom:2.0.6 from http://repo1.maven.org/  
  13.  maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or  
  14.  updates are forced. Original error: Could not transfer artifact org.apache.maven:maven-plugin-api:pom:2.0.6 from/to central (http://  
  15.  repo1.maven.org/maven2): null to http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-  
  16.  api-2.0.6.pom  
  17. - CoreException: Could not get the value for parameter compilerId for plugin execution default-testCompile:  
  18.  PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be  
  19.  resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2 ():  
  20.  ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven:maven-plugin-api:jar:2.0.6:  
  21.  ArtifactResolutionException: Failure to transfer org.apache.maven:maven-plugin-api:pom:2.0.6 from http://repo1.maven.org/  
  22.  maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or  
  23.  updates are forced. Original error: Could not transfer artifact org.apache.maven:maven-plugin-api:pom:2.0.6 from/to central (http://  
  24.  repo1.maven.org/maven2): null to http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-  
  25.  api-2.0.6.pom  
  26. - Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources failed: Plugin  
  27.  org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect  
  28.  dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-  
  29.  plugin:2.4.3:resources:default-resources:process-resources)  
  30. - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:  
  31.  2.3.2:testCompile (execution: default-testCompile, phase: test-compile)  

 

错误信息出现在pom头的project标签,project标签内容是:

Xml代码
  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  2.  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">  

 原:

这是由于缺少maven-resources-plugin-2.4.3.jar文件。这个文件是在{user.home}\.m2 \repository\org\apache\maven\plugins\maven-resources-plugin\下。 {user.home}是maven的配置路径,一般是我的文档,是window-preferences-MyEclipse- Maven4MyEclipse-User Setting里面的Local Repository。

 

解决方案

1、在pom.xml文件中加入maven-resources-plugin配置

Xml代码
  1. <dependency>  
  2.     <groupId>org.apache.maven.plugins</groupId>  
  3.     <artifactId>maven-resources-plugin</artifactId>  
  4.     <version>2.4.3</version>  
  5. </dependency>  

 
2、在命令行下运行mvn install ,如果执行正确应该会在{user.home}\.m2\repository\org\apache\maven\plugins\maven- resources-plugin\下看到maven-resources-plugin-2.4.3.jar文件
3、刷新工程(右键工程选择刷新项)

4、刷新maven配置,右键工程节点,选择Maven4MyEclipse-Update Project Configuration

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-war-plugin:2.1.1 or one of

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-war-plugin:2.1.1 or one of

1.导入项目时报以下错误.

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-war-plugin:2.1.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for 

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-war-plugin:2.2

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-war-plugin:2.2

maven第一次创建打包方式为war的项目报错下图的错,一般是第一次下载相关的文件时候出错,需要进入到maven的本地仓库中删除报错的文件,让它重新下载。

 

 

 

 

 

 删除文件夹后,报错的项目右键选择maven>update project,重新下载该文件

下载完成后pom.xml文件还会有错误,如下图

 

 

 解决方法:

方法一:项目右键选择java EE tools > Generate Deployment....

 

 

 方法二:

项目右键properties

 

重新勾上后,如下图:

 

 

上面的两种解决方法的目录结构会不一样

第一种的目录结构:                      第二种的目录结构:

       

不知道有没有一次性解决的方法,上面这两种都是要创建项目后,操作一次。

如果还有另外的解决方法,欢迎在评论区讨论。

关于Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (htt的介绍现已完结,谢谢您的耐心阅读,如果想了解更多关于build.plugins.plugin.version'' for org.apache.maven.plugins:maven-compiler-pl、clipse加载maven工程提示pom.xml无法解析org.apache.maven.plugins:maven-resources-plugin:、Could not calculate build plan: Plugin org.apache.maven.plugins:maven-war-plugin:2.1.1 or one of、Could not calculate build plan: Plugin org.apache.maven.plugins:maven-war-plugin:2.2的相关知识,请在本站寻找。

本文标签: