Ebony Maw Ebony Maw - 21 days ago 5
Git Question

I need to transfer an already built maven project to a new machine

I cannot build the project again on the new machine as I do not have access to the Maven repository, nor do I have the access to the git repository. How would I accomplish this? I would assume that I would only need to copy the project directory along with the

c:\users\...\.m2\repository
over to the new machine, but I'm sure there is more to it than just these two steps.

Asked another way, the question is: How do I share/host/daisy-chain a private Git repository so that I can easily access it when I'm not on the network?

I copied over my eclipse directory, my .m2 directory, as well as my project directory. I have tons of "Cannot be resolved to a type" errors. Clearly, something is missing here.

Answer

reconfigure repository tag in your pom.xml like this

<repositories>
    <!-- make this repository at the first item in the list -->

    <repository>
        <id>local</id>
        <url>file://[your custom .m2 path]</url>
    </repository>

    <repository>
        <!-- other repositories here -->
    </repository>

</repositories>