Hey folks, just a quick tip Andrea thought I should send to the list since it might be useful for others.
Anyone who builds a maven project that depends on geotools snapshot dependencies has felt the following pain.
- You update
- Do an offline build, which fails because someone added a new library dependency
- You do an online build which downloads a bunch of new GeoTools jars
What i do is set up a profile in my local settings.xml file which basically forces maven to skip downloading snapshots from the osgeo and opengeo repositories.
~/.m2/settings.xml
no-snapshots
opengeo
opengeo
false
never
[http://repo.opengeo.org/](http://repo.opengeo.org/)
osgeo
Open Source Geospatial Foundation Repository
[http://download.osgeo.org/webdav/geotools/](http://download.osgeo.org/webdav/geotools/)
false
never
Then whenever i need to build online but want to skip geotools snapshots i just use “-P no-snapshots”.
Be interested to know if other folks have their own solutions for this.
-Justin
–
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
I build using "-nsu" (no snapshot updates), a new flag present in Maven 3.0.4 or later. This is a great way (IMHO) to build GeoServer against known-version local builds of GeoTools and GeoWebcache (its only snapshot dependencies) without risking an unintended download of remote snapshots. It also makes an online build much, much faster, because snapshots are always checked for updates, and releases are not.
Kind regards,
Ben.
On 28/09/12 15:32, Justin Deoliveira wrote:
Hey folks, just a quick tip Andrea thought I should send to the list
since it might be useful for others.
Anyone who builds a maven project that depends on geotools snapshot
dependencies has felt the following pain.
1. You update
2. Do an offline build, which fails because someone added a new library
dependency
3. You do an online build which downloads a bunch of new GeoTools jars
What i do is set up a profile in my local settings.xml file which
basically forces maven to skip downloading snapshots from the osgeo and
opengeo repositories.
~/.m2/settings.xml
<settings>
<profiles>
<profile>
<id>no-snapshots</id>
<repositories>
<repository>
<id>opengeo</id>
<name>opengeo</name>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
<url>http://repo.opengeo.org/</url>
</repository>
<repository>
<id>osgeo</id>
<name>Open Source Geospatial Foundation Repository</name>
<url>http://download.osgeo.org/webdav/geotools/</url>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
</settings>
Then whenever i need to build online but want to skip geotools snapshots
i just use "-P no-snapshots".
Be interested to know if other folks have their own solutions for this.
-Justin
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre
Clarification: *without* -nsu, snapshots are always checked for updates, and releases are not. *With* -nsu, they are treated the same and only downloaded if missing. So with -nsu you can have the benefit of being online to download missing dependencies without unexpected snapshot checks or snapshot update races (local build versus Hudson).
On 28/09/12 15:48, Ben Caradoc-Davies wrote:
It also makes an online build much, much faster, because
snapshots are always checked for updates, and releases are not.
--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre