Try mvn -e or mvn -X which should show you more information about the
failure/error.
Wayne
On 6/14/07, Tawfik, Sameh E <[EMAIL PROTECTED]> wrote:
Hi Wayne,
When I set JAVA_1_5_HOME to C:\Program Files\Java\jdk1.5.0_1 in mvn.bat
file everything works fine.
But, I wanted to use the alternative method by modifying the parent POM,
so I made the following changes:
The first part works fine, where it is set to configure the Java
compiler to allow JDK 5.0 sources.
But the second part is not working? Something is wrong. It seems it is
not set correctly or there is something else?
I set an environment variable JAVA_1_5_HOME to C:\Program
Files\Java\jdk1.5.0_1, and when I run mvn compile, I get the following
error message:
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Compilation failure
Failure executing javac, but could not parse the error:
Here is my parent POM code:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<verbose>true</verbose>
<fork>true</fork>
<executable>${JAVA_1_5_HOME}/bin/javac"</executable>
<compilerVersion>1.5.0_11</compilerVersion>
</configuration>
</plugin>
</plugins>
</build>
Thanks,
Sameh
-----Original Message-----
From: Wayne Fay [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 31, 2007 6:17 PM
To: Maven Users List
Subject: Re: How to reset java.home value from inside a pom file?
Realistically, you should set the JAVA_HOME in Windows Control Panel
etc so it is set to 1.5.0_11 permanently for all apps. Then you can
set compiler configuration parameters in your pom to target/source a
different Java version as needed.
Alternatively, you can edit the mvn.bat file and set your JAVA_HOME
there. Set it near the top as the value is checked at some point and
fails if it is not set.
Finally, you can check the documentation for maven-compiler-plugin if
you really want to set up multiple compilers in your project for some
reason (this is generally not done, and not advised unless you have a
specific need for a complicated configuration).
Wayne
On 5/31/07, Tawfik, Sameh E <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm using Maven version: 2.0.6, and I've different versions of java
sdk
> installed on my machine.
>
> Currently on my WindowsXP, JAVA_HOME is set to C:\j2sdk1.4.2_13, but
> when I run maven I need to have JAVA_HOME set to C:\Program
> Files\Java\jdk1.5.0_11 instead.
>
> I can reset the value of JAVA_HOME variable to the needed value and
that
> will work fine when I run maven, but is there a way where I can
override
> the default value from inside the pom file?
>
> Could anyone let me know if this step can be accomplished?
>
> Thanks,
>
> Sameh
> This email and any files transmitted with it are confidential,
proprietary
> and intended solely for the individual or entity to whom they are
addressed.
> If you have received this email in error please delete it immediately.
>
>
> ---------------------------------------------------------------------
> 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]
This email and any files transmitted with it are confidential, proprietary
and intended solely for the individual or entity to whom they are addressed.
If you have received this email in error please delete it immediately.
---------------------------------------------------------------------
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]