Marco Dinatsoli
Marco Dinatsoli

Reputation: 10570

maven add dependency located on a local repository

I have a maven project from Github, I fork it, and then I imported it to eclipse. It contains three maven modules. I added a fifth one.

Now I want to add this fifth (new) as a dependency to one of the previous modules.

I did the install in maven, and I got the jar located in my local repository. now when I added a dependency to a one of the previous modules, i got error that my new models doesn't exist in the public dependency. I mean:

Failed to execute goal on project moquette-broker: Could not resolve dependencies for project org.eclipse.moquette:moquette-broker:jar:0.7: Failure to find org.eclipse.moquette:moquette-configurationmanager:jar:0.7 in https://repo.eclipse.org/content/repositories/paho-releases/ was cached in the local repository, resolution will not be reattempted until the update interval of Paho Releases has elapsed or updates are forced -> [Help 1]

my question is how can I tell eclipse to search in my local repository as well?

I tried to upload my dependency to a public repository but it doesn't make any sence now because i am still developing

could you help please

the jar in my local repository

enter image description here

this is what i put in the pom in order to call my new module

<dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>moquette-configurationmanager</artifactId>
            <version>${project.version}</version>
            <scope>Test</scope>
        </dependency>

and the image that i published is my local repository, because i can see that from my eclipse, like this: enter image description here

Upvotes: 1

Views: 470

Answers (1)

Little Santi
Little Santi

Reputation: 8783

After reading the first 28 comments and responses to your question, I still cannot imagine the cause of this strange error, so you'll have to debug it a bit more:

Two recommendations to debug the Maven build:

  • Whatever test you run, execute mvn --debug <phase> and analyze carefully the produced log.
  • Run mvn dependency:build-classpath to ask Maven where are the downloaded libraries referenced in the classpath.

Upvotes: 1

Related Questions