1
votes

When I try to build/clean/install with maven I get the error below. Maven 2 worked but didn't download a package into the .m2/repository/ so I tried uninstalling maven 2 (sudo apt-get remove maven2) and reinstalling (sudo apt-get install maven2), setting the local repository to a map of my choosing in settings.xml of the maven map but I must've done something wrong. Anyone that can help me out?

[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

This is my 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
Do you have a firewall or something like that in the way?Donal Fellows
I don't think so... It worked fine before the reinstall!Don
I asked because the POM appears to be exactly where it should beDonal Fellows
The problem is located in this: not found in repository: Unable to download the artifact from any repository . Are you behind a proxy? Not online? Problem with external connections?khmarbaise
I do run it in a virtual box, but I can use the browser of that virtual machine with no issues...Don

1 Answers

1
votes

First check if maven is working or not after reinstalling

If it is working, there is chance that u downlaod a particular jar which needs credentials or proxy settings. Either define it in settings.xml or in pom.

remove all ur .m2 folder's repository and place settings.xml if neccessary

Its better if you share your pom.xml