Is there a way to make Maven download snapshot versions automatically?

前端 未结 7 764
灰色年华
灰色年华 2021-02-05 08:27

So I have a project that depends on a snapshot version of another project. The dependency is:


  org.oop
  

        
7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-05 08:56

    Maven would try to download the snapshot automatically and indeed it does (as your error indicates). By default, Maven will look for newer snapshot versions once a day, but you can change that interval in your snapshot repository config (e.g. in settings.xml):

    interval:5
    

    This will make maven check every 5 minutes (if you build that often). Alternatively, you could use the -U or --update-snapshots option, to force the check manually.

    However, it can't find the dependency. Could you post your repo settings and artifact config for the snapshot dependency?

    Is the org.oop:oop:jar:0.9.9-SNAPSHOT artifact in your repository?

    ... so the snapshot version should be somewhere in the maven central repository.

    No it isn't. I tried to look it up, but couldn't find it. Afaik, there's some staging mechanism, so maybe your settings are just wrong. But normally, as the others already said, you'd go and use your own repository manager like Artifactory or Nexus.

提交回复
热议问题