存储库中找不到POM'org.apache.maven.plugins:maven-clean-plugin'

时间:2014-04-20 14:03:14

标签: maven

当我尝试使用maven构建/清理/安装时,我收到以下错误。 Maven 2工作但没有将软件包下载到.m2/repository/,所以我尝试卸载maven 2(sudo apt-get remove maven2)并重新安装(sudo apt-get install maven2),将本地存储库设置为我选择的地图在maven地图的settings.xml,但我一定做错了。任何可以帮助我的人?​​

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).

Project ID: org.apache.maven.plugins:maven-clean-plugin

Reason: POM 'org.apache.maven.plugins:maven-clean-plugin' not found in repository: Unable to download the artifact from any repository

  org.apache.maven.plugins:maven-clean-plugin:pom:2.3

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)

 for project org.apache.maven.plugins:maven-clean-plugin

这是我的POM.xml

 <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>be.ugent.sop.p404</groupId>
  <artifactId>P404</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>pom</packaging>
  <name>P404</name>


    <build>
          <plugins>
                <!-- Set to compile using JDK 7 -->
                <plugin>
                      <artifactId>maven-compiler-plugin</artifactId>
                      <version>3.1</version>
                      <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                      </configuration>
                </plugin>
                      <!-- Avoid war plugin complaining missing web.xml -->
                      <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <version>2.3</version>
                        <configuration>
                          <failOnMissingWebXml>false</failOnMissingWebXml>
                        </configuration>
                      </plugin>
            </plugins>
      </build>

    <modules>
        <module>P404WAR</module>
        <module>P404EJB</module>
        <module>P404EAR</module>
    </modules>
</project>

1 个答案:

答案 0 :(得分:1)

重新安装后,首先检查maven是否正常工作

如果它正常工作,您可能需要下载需要凭据或代理设置的特定jar。在settings.xml或pom中定义它。

删除所有您的.m2文件夹的存储库,并在必要时放置settings.xml

如果您分享pom.xml

,情况会更好