Reputation: 1606
I was given a zip file with the content of another user's maven local repository (~/.m2/repository
) and then I was given a zip file with a maven project.
If I go into the project (com.foo.my.project
) and run mvn -X clean install
it fails to download from maven central repository a custom library pom (com.foo.bar
):
[DEBUG] Reading global settings from /home/user/apache-maven-3.5.2/conf/settings.xml
[DEBUG] Reading user settings from /home/user/.m2/settings.xml
[...]
[DEBUG] Using local repository at /home/user/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /home/user/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Verifying availability of /home/user/.m2/repository/com/foo/bar/1.0.0/bar-1.0.0.pom from [central (https://repo.maven.apache.org/maven2, default, releases)]
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.foo.my.project:project:4.2.1: Failure to find com.foo:bar:pom:1.0.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 4, column 13
I can I tell maven to not attempt to check remote availability of a custom package which is only present in local repository?
Upvotes: 2
Views: 1363
Reputation: 876
Delete the file /home/user/.m2/repository/com/foo/bar/1.0.0/_remote.repositories and any SHA files in that folder and rerun the maven build command.
Upvotes: 3