Reputation: 121
I downloaded and imported a multi-module maven project say Project-A. In installed one of its modules say moduleA1 into my local repository and I can see it in the repository directory.
I created another Project-B which has moduleA1 as a dependency. But when I try to package Project-B, I notice that maven is searching for moduleA1 in the online central repository and it fails.
This is the error I get:
[ERROR] Failed to execute goal on project <project-B>: Could not resolve dependencies for project <Project-B>:war:1.0: Failed to collect dependencies at <moduleA1>:jar:<version>: Failed to read artifact descriptor for <moduleA1>:jar:<version>: Failure to find <moduleA1-groupId>:<moduleA1>:pom:<version> 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 -> [Help 1]
[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/DependencyResolutionException
How can I make maven to resolve this moduelA1 dependency from my local repository.
Upvotes: 0
Views: 1274
Reputation: 8012
This problem can occur if you have some child projects that refer to a parent pom (moduleA1 in your case) and you have not installed from the parent pom directory (run mvn install from the parent directory (i.e. Project-A in your case)). If one of the child projects (moduleA1 in your case) may depend on a sibling project (let's assume you have another module moduleA2) and when it goes to read the pom of the sibling, it will fail with the error mentioned in the question unless you have installed from the parent pom directory at least once. So just try running:
mvn -U clean install
from your Project-A directory
Upvotes: 2
Reputation: 35785
Maven automatically resolves dependencies from the local repository.
Without the exact error message, it is difficult to give a more precise answer.
Upvotes: 0