Where to put Maven dependencies?

So for my project I have 2 locally built java dependencies built with maven. On my Windows machine I first built the empty project, and then added the local dependencies in the POM under <dependencies>. That seemed to work.

I have now migrated the evolved project to a linux machine. When trying to initialize the project by running ./mvnw It says that it could not resolve my dependencies, because they couldn’t be found in central.

Am I adding those dependencies in the wrong way, or do I have to add anything in linux to make mvnw consider also locally built dependencies?

Thanks in advance.

If you have local dependencies that you also must build that on Linux

yes, those local dependencies are also built in linux and I have confirmed that they exist in the local m2 repo

But then everything should work

Can you post the log of your build

here’s the detailed log
log (67.5 KB)

and the pom
pom.xml (7.67 KB)

and here’s the local dependency in the m2 repo


referring to the log:
the dopler-decision, ovm, ppr-dsl should be transitive dependencies of the aggregator pom dependency

Is /root/.m2/repository the same repository as shown in your last picture? Just want to ensure you do not have two different repositories.

I would normally not mix root and own user but keep them separate.

This does not mean that it have to be related to your problem however.

there is a repo under /root/.m2/repositorybut it’s missing the jars of the dependencies. Would it be enough to populate it with the jars from the home repo?
Or can i redirect the build of the local dependencies to use that repo?

Ok then we have found your problem. Becuase this is the repository that is referenced when you are building

what’s the recommended way to fix this? change the local maven config to point to the repository under root?

Line 84 in your log [DEBUG] Using local repository at /root/.m2/repository

I would recommend to have a clear separation between user root and user dario

Dario should have project directory, access to maven, java, etc.

Dario user should be able to build