0

I don't know if there is a better title for this post (please suggest) but the situation is this: in my .m2/repository folder there are some dependencies with all the configuration files and the corresponing jar but in others I have the config files but not the jar. For instance, in .m2/repository/ant/ant/1.5/ I have the files:

_maven.repositories
ant-1.5.pom
ant-1.5.pom.lastUpdated
ant-1.5.pom.sha1

and ant-1.5.jar is missing. Is there a way to add these missing jar's to the local repository?

Thanks in advance for your answers.

7
  • Delete the folder .m2/repository/ant and restart your build..sometimes this happens if the network connection is not stable or fails or if you give wrong coordinates ....
    – khmarbaise
    Commented Jun 27, 2017 at 14:01
  • I'd like to do it for all the dependencies in that state. With your solution I should rebuild all my projects and that's not a happy task for me :P Commented Jun 27, 2017 at 14:06
  • If you have such issues Hm...Don't you use a CI solution like Jenkins ? So you should be able delete the whole local cache .m2/repository/... ? Why do you need to rebuild all of your projects? I would have expected that you have many errors if some of the jar's can't found or at least [WARNING] ... in your build...Do you use a repository manager ?
    – khmarbaise
    Commented Jun 27, 2017 at 15:05
  • I've heard about Jenkins but I'm not using it (yet). In fact, I was doing some checking in my local repository due to a new project I'm starting to work in and I found this issue. I was wondering if there is some way to do some "local repository maintenance", do you get what I mean? Commented Jun 27, 2017 at 15:15
  • I got it. The point is your projects should be first in version control and from there it shouldn't be a big issue to rebuilt them. If you have more than 10 projects than you are doing it wrong and you should do them via Jenkins or something similar...And the best maintenance I know of is simply delete it completely and build your project...btw. The local repository is not a repository it is only a local cache...don't mistaken that...Start using a repository manager to hold the built artifacts in a reproducible manner...
    – khmarbaise
    Commented Jun 27, 2017 at 15:56

1 Answer 1

1

The point is your projects should be first in version control and from there it shouldn't be a big issue to rebuilt them. If you have more than 10 projects than you are doing it wrong and you should do them via Jenkins or something similar...And the best maintenance I know of is simply delete it completely and build your project...btw. The local repository is not a repository it is only a local cache don't mistaken that...Start using a repository manager to hold the built artifacts in a reproducible manner...

Not the answer you're looking for? Browse other questions tagged or ask your own question.