One additional note per the previous: Scenario: Suppose we start from scratch with Maven, and point it to our repository mirror / our own repository.
Now Maven goes ahead and initializes itself. However our repository is down, so Maven ends up going to Ibiblio anyways. Possible Solution: rsync our repository into the m2 directory on our machines, and then set maven to work offline. --- Ole Ersoy <[EMAIL PROTECTED]> wrote: > Brett, > > Thanks for the info. > > I put together some additional notes that I think > are > inline with our current goals for the build process. > > I still have to validate that this will all work as > expected, but I figured I would get the notes out > here > in case anyone wants to get started (These are in > APT > format, so if you want just cut and paste into the > apt > directory of a mvn project and run site to get the > html version): > > -------------------------------------------------------------------------------------- > > Build Process > > -------------------------------------------------------------------------------------- > > Maven Repository Setup > > Per the Maven > http://maven.apache.org/guides/introduction/introduction-to-repositories.html > documentation setting up a repository is just a > matter of mirroring the type of file > structure used on for example ibiblio. > > Then add a repositories element to the pom like > this: > ------------------------------------------------------------------------------------- > <project> > ... > <repositories> > <repository> > <id>adsr</id> > <name>Apache Directory Repository</name> > <url>http://m2.safehouse.org</url> > <layout>default</layout> > <repository> > </repositories> > ... > </project> > ------------------------------------------------------------------------------------- > > Now - in our case we probably want to turn off > Ibiblio as well. I asked how to > do that on the users group, and Wayne Fay said > to > just setup a mirror of > central like this in settings.xml: > > ------------------------------------------------------------------------------------- > > <mirrors> > <mirror> > <mirrorOf> > central > </mirrorOf> > <name>Apache Directory Repository</name> > <url>http://m2.safehouse.org</url> > <id>adsr</id> > </mirror> > </mirrors> > > ------------------------------------------------------------------------------------- > > > > Going Offline > > To run Maven offline add this to settings.xml > ------------------------------------------------------------------------------------- > <settings> > <offline>true</offline> > </settings> > ------------------------------------------------------------------------------------- > > Checksum Automation > > If a newer version of a dependency we are using > > with the same version number is available, do > we > want to > download it? > > Does Maven do a timestamp check on dependencies > with the > same version number that we already have, and > if > available download it? > > I have to test it to see whether it does. > > If we have our own repository mirror, then > Maven > should always go there > and ibiblio will not be consulted. > > However if our mirror is down, then it might go > to ibiblio. > > So the concern can be restated like this: > > "If our mirror is down, and Maven sees > dependencies or plugins with > a more recent timestamp, but same version as > we > are currently using > in the build, will it download and replace our > current files with > the more recent files"? > > Or in other words does Maven treat versioned > dependencies and plugins > like SNAPSHOTS? > > If the answer to this ends up being no, then > we > are safe, because > we will be initializing our maven installation > from the mirror repository. > > Plugin Version Management > > ------------------------------------------------------------------------------------- > > Specify Plugin Versions in the POM > > <build> > <plugins> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-compiler-plugin</artifactId> > <version>Set the Version of the Plugin > Here</version> > </plugin> > </plugins> > </build> > > ------------------------------------------------------------------------------------- > > As an alternative we can use the > plugin-registry.xml File to Manage Plugin Versions > > > Dependency Version Management > > All dependencies should have the associated > version set. > > ------------------------------------------------------------------------------------- > > <dependencies> > <dependency> > <version> > Set the version here > </version> > </dependency> > ------------------------------------------------------------------------------------- > > > Remember that if the dependency is a SNAPSHOT, > then this tells maven to get the latest file. > > > > > > > --- Brett Porter <[EMAIL PROTECTED]> wrote: > > > Here is an explanation of the problem and how to > > make your build more > > predictable: > > > http://mail-archives.apache.org/mod_mbox/maven-users/200608.mbox/[EMAIL PROTECTED] > > > > Basically it comes down to only using snapshot > > plugins when you really > > really have to. Currently, too many projects are > > setting their default > > builds to grab all the unstable plugins, which is > > obviously a receipe > > for disaster. > > > > We're certainly working to improve that story for > > future Maven releases. > > > > I have now turned off > snapshots.maven.codehaus.org, > > so the errors > > should be a whole lot less subtle if it is still > in > > use anywhere else > > :) > === message truncated === __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
