I'm surprised the transitive dependency to that parent succeeds, unless it's ranged.
For the others, in order to determine the dependency tree, and thus any transitive dependencies, and so on, the entire pom needs to be present. A parent is part of that. If the parent is of a fixed version (all that's currently supported IIRC) and not present, then it should fail otherwise it's going to produce something potentially quite different to what the developer intended (or accidentally indicated that they intended). I'm wondering what SNAPSHOTs are doing in a remote, but I know some people operate that way. I wouldn't/don't. Another thing I wouldn't do is stick dependencies in a parent, period. Or use a snapshot parent, ever. Interested to read what the gurus come back with, though :-) Regards, Fred. On Thu, Aug 4, 2016 at 3:36 AM, Thiebaud, Christophe < [email protected]> wrote: > Hi All, > > > > The title says it all. > > > > Any suggestions how to overcome this issue ? > > > > Explanation below. Let the projects be: > > > > ‘parent’ : the parent pom of the ‘lib’ library just below > > ‘lib’ : the library > > ‘app’ : the application dependent on ‘lib’ through a version range. > > > > (all three minimalistic sample projects here: https://github.com/iroif) > > > > > > Here is what happens during time, when versions are bumped and projects > are deployed to remote repo: > > > > day 0 > > > > ‘parent’ 0.0.1-SNAPSHOT is deployed to remote repo > > ‘lib’ 0.0.1-SNAPSHOT is deployed to remote repo > > ‘app’ builds OK > > > > day 1 > > > > ‘parent’ 0.0.1-SNAPSHOT is still on remote repo > > ‘parent’ 0.0.2-SNAPSHOT is deployed to remote repo > > ‘lib’ 0.0.1-SNAPSHOT is still on remote repo > > ‘app’ builds OK > > > > day 2 > > > > ‘parent’ 0.0.1-SNAPSHOT is still on remote repo > > ‘parent’ 0.0.2-SNAPSHOT is still on remote repo > > ‘lib’ 0.0.1-SNAPSHOT is still on remote repo > > ‘lib’ 0.0.2-SNAPSHOT is deployed to remote repo > > ‘app’ builds OK > > > > day 3 > > > > ‘parent’ 0.0.1-SNAPSHOT is automatically evicted from remote repo by some > rule > > ‘parent’ 0.0.2-SNAPSHOT is still on remote repo > > ‘lib’ 0.0.1-SNAPSHOT is still on remote repo > > ‘lib’ 0.0.2-SNAPSHOT is still on remote repo > > *‘app’ build FAILS* > > > > this is because maven tries to build the pom for ‘lib’ 0.0.1-SNAPSHOT and > fails as ‘parent’ 0.0.1-SNAPSHOT is not available anymore. > > > > However, IMHO, the build of ‘app’ should not fail as there is another > valid dependency resolution : ‘lib’ 0.0.2-SNAPSHOT with ‘parent’ > 0.0.2-SNAPSHOT. > > > > In fact, when the relationship between parent and lib is a dependency (and > not a parent-child relationship), the build of ‘app’ succeeds, even when > transitive dependency to ‘parent’ 0.0.1-SNAPSHOT cannot be resolved. > > > > Note that ‘app’ build is successful again, when on day 4, ‘lib’ > 0.0.1-SNAPSHOT is in turn evicted: > > > > day 4 > > > > ‘parent’ 0.0.2-SNAPSHOT is still on remote repo > > ‘lib’ 0.0.1-SNAPSHOT is automatically evicted from remote repo by some > rule > > ‘lib’ 0.0.2-SNAPSHOT is still on remote repo > > *‘app’ build resumes OK* > > > > Any suggestions how to overcome this issue ? > > > > We have builds failing every other day in our build farm for this reason. > > > > Thanks! > > Christophe > > PS. The content of this mail is duplicated here : > https://github.com/iroif/iroif-parent > > >
