On Fri, Jun 17, 2011 at 2:46 AM, Spencer Allain <spencer_all...@yahoo.com>wrote:

> If you set up a flatDir resolver it will never copy the artifacts into the
> cache, and hence you'll always get the "latest" version using version
> numbers or even just the static -SNAPSHOT classifier.
>
>
Spencer, that is what I was looking for, thanks. When I wrote the first
email in this I had tried this, but I think I had a configuration error that
meant that I did not get the behaviour I was expecting as I was still
pulling the old jar from the cache. I am happy to not use the SNAPSHOT
nomenclature and I can confirm that you still get the latest jar from
project 1 imported into project 2 when you just use version number (eg
1.0.0).

On Fri, Jun 17, 2011 at 2:46 AM, Spencer Allain <spencer_all...@yahoo.com>
 wrote:

> repositories {
>   // NOTE: Pin repository path to project since it will always exist,
>   //       but change patterns
>   flatDir name: 'localRepository', dirs: path
>
>   localRepository {
>     def patterns = [repoPath +
> '[module](-[revision])(-[classifier]).[ext]']
>     setArtifactPatterns(patterns)
>   }
> }


This is the answer to the last piece of the puzzle I was trying
to resolve. With this snippet above we can have a single local developer
repository for all the projects that are in development, where project 2
will pull in the output of project 1.

I would suggest the following change for the above:

def patterns = [repoPath +
'[organisation]-[module](-[revision])(-[classifier]).[ext]']

By adding in the organistation, when you have two multi module project
builds both with modules called "core" or "common" then you will still be
able to use the localRepo without conflicts in the flat dir ie:
project1-core.1.0.jar and project2-core.1.0.jar

Thanks for the help,

-Mike

Reply via email to