I need to hand over a project to a third person. The project uses Maven for dependency management and we have a Nexus repository manager installed.
I thought it would be easy to generate a repository with all dependencies needed by the project using the dependency:go-offline plugin/goal like
mvn dependency:go-offline -Dmaven.repo.local=c:/handOver/.m2/repository
The repository is created as expected by this command. I copied this repository to the target machine and set the localRepository (settings.xml) to the repository folder.
Trying to build the project on the target machine unfortunatly fails. The build process complains about missing artifacts although they are at the path that can be found in the maven logs (even using the -o / offline switch).
There still seems to be a relation to our Nexus server. We therefore deleted all _maven.repositories files in the repository but that does not helped either.
I wonder if my approach of handing over a repository could work and what I did wrong or missed. I fear it has something to do with the remote repository settings.
It would be a great help if anybody could point me to the right direction on how to hand over a maven repository to someone else.
from the logs
(the jar that should be resolved can be found under the logged path (C:\handOver.m2\repository{myPathToJar}) but can not be resolved at the end.
[DEBUG] Using local repository at C:\handOver\.m2\repository
...
[DEBUG] Verifying availability of C:\handOver\.m2\repository\{myPathToJar}
from [central (https://repo.maven.apache.org/maven2, default, releases)]
...
[ERROR] Failed to execute goal on project {myProject}: Could not resolve dependencies for project {myProject}:
The following artifacts could not be resolved: {myDependency}: Cannot access central (https://repo.maven.
apache.org/maven2) in offline mode and the artifact {myDependency} has not been downloaded from it be
fore. -> [Help 1]