Search code examples
mavenpom.xmlparent-pom

Maven: Can't find artifact on downloaded projects pom


After downloading a pom from a project (which I know builds fine on the remote build tools), I get this error when trying to test it locally:

$ mvn clean install -DskipTests
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/com/x/nms/integration/15.2.0.19/integration-15.2.0.19.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.x.oss.itpf.diagmon.taf:your-testware:2.20.7-SNAPSHOT: Could not find artifact com.x.nms:integration:pom:15.2.0.19 in central (httpepo.maven.apache.org/maven2) and 'parent.relativePath' points at wrong local POM @ line 5, column 13
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project com.x.oss.itpf.diagmon.taf:ddc-testware:2.20.7-SNAPSHOT (C:\Users\erayfra\Workspace\ddc-testware\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.x.oss.itpf.diagmon.taf:your-testware:2.20.7-SNAPSHOT: Could not find artifact com.x.nms:integration:pom:15.2.0.19 in central (://repo.maven.apache.org/maven2) and 'parent.relativePath' points at wrong local POM @ line 5, column 13 -> [Help 2]
[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/UnresolvableModelException

Solution

  • Looks like, the problem is -

        Could not find artifact com.x.nms:integration:pom:15.2.0.19 
        in central (://repo.maven.apache.org/maven2)
    

    So, there are 2 things -

    1. The artifact you are trying to include in your project is not available at the path of repository you specified.(Its the same what error message is saying)
    2. You can change the repository path where maven is trying to find for this artifact : from repo.maven..., to the correct one. You could do this by

      • modifying the path either in your local pom,

        • or by changing it globally by editing the settings.xml file localed at .m2/settings.xml. .m2 is a hidden folder under /Users/{yourName} ( same location for both windows and mac)