Hello,
like several others, we have had tons of problem with the Maven 2 plugin
for Eclipse trying to resolve indirect dependencies which are defined in
the POM as "{project.version}" as version "2.4.1", regardless of what
the actual version of the project is. My colleague Maulin Gajjar here at
Zementis has finally exactly pinpointed why "some people" (more
precicely, some machines) have this problems and others do not:. This is
the sequence of collaborating bugs which lead to the failing
dependencies on "2.4.1" versions:
- if Java 1.4.2 is the first entry in the %PATH% on the machine, this
java version will be used to run eclipse
- Java 1.4.2 contains some Apache XML parser that defines, among others,
a silly environment variable "version" with value "2.4.1"
- m2plugin tells Maven (if I understand correctly) via Maven Embedder to
evaluate dependencies
- Maven Embedder has a bug (or "feature") by which variables like
{project.version}are overridden by corresponding system variables (i.e.
"version").
- as a result, Maven is looking for version "2.4.1" of such dependencies
instead of the desired value of {project.version}, and fails to build
To work around this series of unfortunate events, simply use the Java 5
JDK and put it in your %PATH% before any other Java version. You can
test which version is used by opening a command prompt and running "java
-version". You can still define another Java JDK inside Eclipse for your
project if they have to compile and run your project under Java 1.4.2.
The key is that eclipse itself needs to run on Java 5 which does not
include the Apache XML parser that defines a "version" environment variable.
Cheers,
-Martin Roth, Zementis Inc., San Diego
Acknowledgements:
- Daniel Schulz describes the "version" variable and its effect in
http://jira.codehaus.org/browse/MNG-2653?rc=1page=comments#action_79316
- Maulin Gajjar solved the mystery of what causes the "version"
environment variable is set
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email