views:

334

answers:

3

My project depends on a 3rd party library that only has snapshots in its maven repository (no releases, which seems strange, but that's how it is). Every time I do a full build (and clean my local .m2 repository) maven will obviously go and grab the latest build.

My repository proxies the one with the snapshots in it, is there anyway to tell my repository to stop pulling new versions and basically just keep the current version? I really don't want to be pulling a new build every night.

The only thought I had is to manually label the current versions, but there quite a few dependencies and they are all dependent on the SNAPSHOT versions. Is there an easier way to do this?

thanks,

Jeff

A: 

Do you run the build with the -U ( -update-snapshots ) option ? If so, try without.

Else, if there is only this dependency on the repository, you could just disable this repository, and Maven will keep using the last version it finds on the local repository.

Julien Nicoulaud
A: 

Did you try to specify the <updatePolicy> with the never strategy in the <snapshots> element of your <pluginRepository>? See Plugin Repositories and Repositories.

Pascal Thivent
+1  A: 

Take a look at this blog entry from sonatype: Best Practices for 3rd Party Snapshot Dependencies

I usually install the file to my proxy or local repo as a certain version, and then refer to that version. Then you don't risk the snapshot disappearing out from under you.

SamBeran
Actually getting rid of the snapshot tag is definitely the route I want to take. The libraries I have don't make it easy though since their full binary distribution doesn't actually come with a POM. But with a little work I should be able to get this installed without the snapshot dependency. Thanks.
Jeff Storey
mvn deploy:deploy-file will create the pom.
SamBeran