help needed with maven antrun plugin
Hi, I am facing a strange problem. I am able to successfully build using an ant build.xml but the same is failing when I am call it using antrun plugin. Has anyone faced similar issue and any clue on how this can be resolved? I don't want to use exec plugin as that will require ant to be installed on all developer machines. In my environment we are using maven 2.0.10, Java 1.6update5. For testing the ant compilation directly I used ant version 1.7.0. Thanks for your help. -Pankaj
Re: help needed with maven antrun plugin
> I am able to successfully build using an ant build.xml but the same is > failing when I am call it using antrun plugin. Specific error messages are more helpful than generic "it didnt work" comments. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: help needed with maven antrun plugin
Here's the exact error. [INFO] [ERROR] BUILD ERROR [INFO] [INFO] An Ant BuildException has occured: The following error occurred while executing this line: build.xml:118: com.bea.util.jam.internal.javadoc.JavadocClassloadingException: An error has occurred while invoking javadoc to inspect your source files. This may be due to the fact that $JAVA_HOME/lib/tools.jar does not seem to be in your system classloader. One common case in which this happens is when using the 'ant' tool, which uses a special context classloader to load classes from tools.jar. This situation elicits what is believed to a javadoc bug in the initial release of JDK 1.6. Javadoc attempts to use its own context classloader tools.jar but ignores one that may have already been set, which leads to some classes being loaded into two different classloaders. The telltale sign of this problem is a javadoc error message saying that 'languageVersion() must return LanguageVersion - you might see this message in your process' output. This will hopefully be fixed in a later release of JDK 1.6; if a new version of 1.6 has become available, you might be able to solve this by simply upgrading to the latest JDK. Alternatively, you can work around it by simply including $JAVA_HOME/lib/tools.jar in the java -classpath parameter. If you are running ant, you will need to modify the standard ant script to include tools.jar in the -classpath. [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 1 minute 40 seconds [INFO] Finished at: Thu Feb 04 21:31:15 GMT 2010 [INFO] Final Memory: 10M/187M [INFO] -Original Message- From: Wayne Fay [mailto:wayne...@gmail.com] Sent: Thursday, February 04, 2010 1:11 PM To: Maven Users List Subject: Re: help needed with maven antrun plugin > I am able to successfully build using an ant build.xml but the same is > failing when I am call it using antrun plugin. Specific error messages are more helpful than generic "it didnt work" comments. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: help needed with maven antrun plugin
AFAIK maven munges up the java home in the system properties so that the ${java.home} is actually the jre inside the jdk and not the jdk... however ${env.JAVA_HOME} should still be the java home and the mvn scripts bomb out if JAVA_HOME is not defined. -Stephen On 4 February 2010 21:26, Pankaj Agarwal wrote: > Here's the exact error. > > [INFO] > > [ERROR] BUILD ERROR > [INFO] > > [INFO] An Ant BuildException has occured: The following error occurred > while executing this line: > build.xml:118: > com.bea.util.jam.internal.javadoc.JavadocClassloadingException: An error has > occurred while invoking javadoc to inspect your source > files. This may be due to the fact that $JAVA_HOME/lib/tools.jar does > not seem to be in your system classloader. One common case in which > this happens is when using the 'ant' tool, which uses a special > context classloader to load classes from tools.jar. > > This situation elicits what is believed to a javadoc bug in the initial > release of JDK 1.6. Javadoc attempts to use its own context classloader > tools.jar but ignores one that may have already been set, which leads > to some classes being loaded into two different classloaders. The > telltale sign of this problem is a javadoc error message saying that > 'languageVersion() must return LanguageVersion - you might see this > message in your process' output. > > This will hopefully be fixed in a later release of JDK 1.6; if a new > version of 1.6 has become available, you might be able to solve this > by simply upgrading to the latest JDK. > > Alternatively, you can work around it by simply including > $JAVA_HOME/lib/tools.jar in the java -classpath > parameter. If you are running ant, you will need to modify the standard > ant script to include tools.jar in the -classpath. > > > [INFO] > > [INFO] For more information, run Maven with the -e switch > [INFO] > > [INFO] Total time: 1 minute 40 seconds > [INFO] Finished at: Thu Feb 04 21:31:15 GMT 2010 > [INFO] Final Memory: 10M/187M > [INFO] > > > -Original Message- > From: Wayne Fay [mailto:wayne...@gmail.com] > Sent: Thursday, February 04, 2010 1:11 PM > To: Maven Users List > Subject: Re: help needed with maven antrun plugin > > > I am able to successfully build using an ant build.xml but the same is > > failing when I am call it using antrun plugin. > > Specific error messages are more helpful than generic "it didnt work" > comments. > > Wayne > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >
RE: help needed with maven antrun plugin
On Yesterday at 1:26pm, PA=>Pankaj Agarwal wrote: PA> Here's the exact error. PA> PA> [INFO] PA> PA> [ERROR] BUILD ERROR [INFO] PA> PA> [INFO] An Ant BuildException has occured: The following error occurred PA> while executing this line: build.xml:118: PA> com.bea.util.jam.internal.javadoc.JavadocClassloadingException: An PA> error has occurred while invoking javadoc to inspect your source Here's my experience. I don't remember when I added this, but here is what I use as a dependency for the maven-antrun-plugin: sun.jdk tools 1.6 system ${java.home}/../lib/tools.jar Works for me, YMMV. Hope that helps. -- Haroon Rafique - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: help needed with maven antrun plugin
I have tried it as below but the error is same. mvn -Djdk.home=/usr/jdk1.6.0_05 clean compile Thanks, Pankaj -Original Message- From: Stephen Connolly [mailto:stephen.alan.conno...@gmail.com] Sent: Thursday, February 04, 2010 2:49 PM To: Maven Users List Subject: Re: help needed with maven antrun plugin AFAIK maven munges up the java home in the system properties so that the ${java.home} is actually the jre inside the jdk and not the jdk... however ${env.JAVA_HOME} should still be the java home and the mvn scripts bomb out if JAVA_HOME is not defined. -Stephen On 4 February 2010 21:26, Pankaj Agarwal wrote: > Here's the exact error. > > [INFO] > > [ERROR] BUILD ERROR > [INFO] > > [INFO] An Ant BuildException has occured: The following error occurred > while executing this line: > build.xml:118: > com.bea.util.jam.internal.javadoc.JavadocClassloadingException: An error has > occurred while invoking javadoc to inspect your source > files. This may be due to the fact that $JAVA_HOME/lib/tools.jar does > not seem to be in your system classloader. One common case in which > this happens is when using the 'ant' tool, which uses a special > context classloader to load classes from tools.jar. > > This situation elicits what is believed to a javadoc bug in the initial > release of JDK 1.6. Javadoc attempts to use its own context classloader > tools.jar but ignores one that may have already been set, which leads > to some classes being loaded into two different classloaders. The > telltale sign of this problem is a javadoc error message saying that > 'languageVersion() must return LanguageVersion - you might see this > message in your process' output. > > This will hopefully be fixed in a later release of JDK 1.6; if a new > version of 1.6 has become available, you might be able to solve this > by simply upgrading to the latest JDK. > > Alternatively, you can work around it by simply including > $JAVA_HOME/lib/tools.jar in the java -classpath > parameter. If you are running ant, you will need to modify the standard > ant script to include tools.jar in the -classpath. > > > [INFO] > > [INFO] For more information, run Maven with the -e switch > [INFO] > > [INFO] Total time: 1 minute 40 seconds > [INFO] Finished at: Thu Feb 04 21:31:15 GMT 2010 > [INFO] Final Memory: 10M/187M > [INFO] > > > -Original Message- > From: Wayne Fay [mailto:wayne...@gmail.com] > Sent: Thursday, February 04, 2010 1:11 PM > To: Maven Users List > Subject: Re: help needed with maven antrun plugin > > > I am able to successfully build using an ant build.xml but the same is > > failing when I am call it using antrun plugin. > > Specific error messages are more helpful than generic "it didnt work" > comments. > > Wayne > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: help needed with maven antrun plugin
I tried it but the error is same. Thanks, Pankaj -Original Message- From: Haroon Rafique [mailto:haroon.rafi...@utoronto.ca] Sent: Friday, February 05, 2010 5:27 AM To: Maven Users List Subject: RE: help needed with maven antrun plugin On Yesterday at 1:26pm, PA=>Pankaj Agarwal wrote: PA> Here's the exact error. PA> PA> [INFO] PA> PA> [ERROR] BUILD ERROR [INFO] PA> PA> [INFO] An Ant BuildException has occured: The following error occurred PA> while executing this line: build.xml:118: PA> com.bea.util.jam.internal.javadoc.JavadocClassloadingException: An PA> error has occurred while invoking javadoc to inspect your source Here's my experience. I don't remember when I added this, but here is what I use as a dependency for the maven-antrun-plugin: sun.jdk tools 1.6 system ${java.home}/../lib/tools.jar Works for me, YMMV. Hope that helps. -- Haroon Rafique - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org