On 06/08/2011 11:47 AM, boraldo wrote:
I am absolutely agree with your opinion that unreproducability of build is a
bad feature, but ...
1. Maven has a built-in mechanism of dependency version range
(http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution#DependencyMediationandConflictResolution-DependencyVersionRanges).
Using this you can set that the build will always include the last version
of some artifact. That makes it absolutely unreproducable. So
unreproducability doesn't contradict with the concepts of Maven and what I
ask could be possible in it too.
Just because Maven can do something does not make it a good idea.
Maven will give you enough rope to hang yourself and there enough really
brilliant people here who can show you how to make the killer knot, so
that it is easy to get hurt.
Just read some of the threads on version range or worse yet - profiles
if you want to see people getting into serious trouble.
2. What I want is absolutely reproducable. Maybe you didn't understand me.
I want an artifact D to include last version of artifact A, but not among
all versions of A but among versions that are present in D's full dependency
tree. As dependency tree is not changed in time we get a reproducable build.
At each moment of time (if artifacts from dependency tree are not changed)
final D's build will include the same version of A.
Moreover, what I want, I suppose, is much more reproducable and logical
behaviour because using standard behaviour you depend very strongly on the
order in which dependencies are declared.
My preference is to control the versions of anything that gets built
into my projects.
Classloaders will only load the first version of a library requested and
if you include 2 versions of a library in a set of jars that you make
available at run-time, you can have some unpleasant and random surprises
- MethodNotFound being the most likely cause of a stack dump.
It is worthwhile to do the planning up front and make sure that you know
what version your builds include and which artifact is going to provide
each of the third party libraries that you need.
An hour at the start of each development cycle is not a high price to
pay for peace of mind.
It takes a bit of thinking to get your POMs set up correctly initially
but it pays off.
Your builds also take less time and your artifacts are smaller since you
will have many modules with a lot of their libraries getting scoped as
"provided" rather than included in the artifact.
--
View this message in context:
http://maven.40175.n5.nabble.com/How-to-use-the-latest-version-from-dependencies-not-from-all-repository-tp4642240p4672834.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]