Re: MAVEN version 2.2.1 and maven-antrun-plugin 1.6 want to compile classes with Java 1.4.2 version
HI All, Thanks for your help. I am able to build my JAR file by using following command. org.codehaus.mojo exec-maven-plugin 1.2 install install exec C:\Documents and Settings\DS100193\workspace\WorkCenterPlatformMavenProject\WPSEjb\WPSEjb.bat Thanks all for your help. And special thanks to Stephen. -Daivish. On Thu, Aug 11, 2011 at 10:46 AM, Daivish Shah wrote: > What is the purpose for moving from Ant to Maven in such environments? > > The purpose is to maintain different versions and to identify which version > of JAR or EAR has issue so we can identify it quickly. > > Thanks, > daivish. > > > On Thu, Aug 11, 2011 at 10:30 AM, Wayne Fay wrote: > >> > We can't move all projects to MAVEN at this moment so idea is to convert >> > some projects from ANT to MAVEN and slowly slowly we can implement or >> > convert all project from ANT to MAVEN. >> >> You don't understand my point. I am not asking why you can't move ALL >> your projects from Ant to Maven. I am asking why you are moving ANY >> projects from Ant to Maven. >> >> I don't see how any of this work is giving you a better build >> environment. You are simply trading complex Ant builds that work for >> complex Maven builds that just call Ant that don't (right now at >> least) work. >> >> What is the purpose for moving from Ant to Maven in such environments? >> >> Wayne >> >> - >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >> For additional commands, e-mail: users-h...@maven.apache.org >> >> >
Re: MAVEN version 2.2.1 and maven-antrun-plugin 1.6 want to compile classes with Java 1.4.2 version
What is the purpose for moving from Ant to Maven in such environments? The purpose is to maintain different versions and to identify which version of JAR or EAR has issue so we can identify it quickly. Thanks, daivish. On Thu, Aug 11, 2011 at 10:30 AM, Wayne Fay wrote: > > We can't move all projects to MAVEN at this moment so idea is to convert > > some projects from ANT to MAVEN and slowly slowly we can implement or > > convert all project from ANT to MAVEN. > > You don't understand my point. I am not asking why you can't move ALL > your projects from Ant to Maven. I am asking why you are moving ANY > projects from Ant to Maven. > > I don't see how any of this work is giving you a better build > environment. You are simply trading complex Ant builds that work for > complex Maven builds that just call Ant that don't (right now at > least) work. > > What is the purpose for moving from Ant to Maven in such environments? > > Wayne > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >
Re: MAVEN version 2.2.1 and maven-antrun-plugin 1.6 want to compile classes with Java 1.4.2 version
> We can't move all projects to MAVEN at this moment so idea is to convert > some projects from ANT to MAVEN and slowly slowly we can implement or > convert all project from ANT to MAVEN. You don't understand my point. I am not asking why you can't move ALL your projects from Ant to Maven. I am asking why you are moving ANY projects from Ant to Maven. I don't see how any of this work is giving you a better build environment. You are simply trading complex Ant builds that work for complex Maven builds that just call Ant that don't (right now at least) work. What is the purpose for moving from Ant to Maven in such environments? Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: MAVEN version 2.2.1 and maven-antrun-plugin 1.6 want to compile classes with Java 1.4.2 version
HI Stephen, I tried the way your way... org.codehaus.mojo exec-maven-plugin 1.2 install install exec C:\test\WPSEjb.bat I am getting exception like this. [wlwBuild] [Build] Build project WPSEjb started. [wlwBuild] [Build] BUILD STARTED [wlwBuild] [Build] build: [wlwBuild] [Build] check-env: [wlwBuild] [Build] Checking to see if there is anything new to build... [wlwBuild] [Build] no-ejbgen: [wlwBuild] [Build] run-build: [wlwBuild] [Build] clean-modules: [wlwBuild] [Build] Running EJBGen... [wlwBuild] [Build] java.lang.NoClassDefFoundError: com/sun/javadoc/RootDoc [wlwBuild] [Build] Exception in thread "main" [wlwBuild] [Build] Java returned: 1 [wlwBuild] [Build] BUILD FAILED [wlwBuild] [Build] Java returned: 1 [wlwBuild] [Build] Let me know how can i setup JAVA_HOME here ? Thanks, daivish. On Thu, Aug 11, 2011 at 10:00 AM, Daivish Shah wrote: > HI Stephen, > > > Use http://mojo.codehaus.org/exec-maven-plugin/exec-mojo.html to run > ANT and you can provide the ENV variables to your hearts content. > > > For this can you give me example how can i setup JAVA_HOME by using > exec-maven-plugin ? I think I can apply "ant -f WPSEjb_build.xml build" > command in this plugin. But please let me know how can i setup My JAVA_HOME > here ? > > Thanks for your help Stephen. > > thanks, > daivish. > > > On Thu, Aug 11, 2011 at 9:10 AM, Stephen Connolly < > stephen.alan.conno...@gmail.com> wrote: > >> Use http://mojo.codehaus.org/exec-maven-plugin/exec-mojo.html to run >> ANT and you can provide the ENV variables to your hearts content. >> >> Or use the http://ant.apache.org/manual/Tasks/exec.html to fork ANT >> with the correct environment variables set. >> >> On 11 August 2011 17:06, Daivish Shah wrote: >> > Hi Barrie, >> > >> > I can't apply JAVAC in my BUILD.XML as i am using Weblogic Workshop >> related >> > .WORK file under my build.xml and there is no way to specify JAVAC for >> this >> > wlwBuild Command. >> > >> > My code for build.xml is something like this. >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> >> > >> value="${java.home}/jre/lib/rt.jar;${java.home}/lib/tools.jar;${weblogic.home}/server/lib/knex.jar;${weblogic.home}/common/lib/log4j.jar;${weblogic.home}/server/lib/debugging.jar;${weblogic.home}/javelin/lib/javelin.jar;${weblogic.home}/server/lib/wlw-lang.jar;${weblogic.home}/server/lib/weblogic.jar;${weblogic.home}/common/eval/pointbase/lib/pbserver44.jar;${weblogic.home}/common/eval/pointbase/lib/pbclient44.jar;${weblogic.home}/server/lib/webservices.jar;${weblogic.home}/server/lib/webserviceclient.jar;${weblogic.home}/server/lib/webserviceclient+ssl.jar;${weblogic.home}/server/lib/wli.jar;${weblogic.home}/server/lib/xbean.jar;${weblogic.home}/server/lib/wlxbean.jar;${weblogic.home}/server/lib/xqrl.jar;${weblogic.home}/server/lib/netui/netui-compiler.jar;${mit.classpath}"/> >> > >> > >> >> > classpath="${weblogic.home}/workshop/wlw-ide.jar"/> >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> >> > serverclasspath="${server.classpath}"> >> > >> > >> > >> > >> > >> > I can't use this plugin >> > http://mojo.codehaus.org/exec-maven-plugin/index.html As i have >> limitation >> > to USE > which >> > generated my class files with all information in .WORK file of my >> project. >> > >> > >> > So i am not sure how can i apply MAVEN ANT Plugin to compile with java >> > version 1.4.2, I am really struggling to get the answer on this. And i >> am >> > stuck here. >> > >> > But i assume that you can provide compiler information in >> > maven-antrun-plugin to execute your build.xml which is not possible with >> > plugin. That's real limitation to use this plugin i guess. >> > >> > Please advice me some work around for my problem. >> > >> > Thanks, >> > daivish. >> > >> > >> > >> > >> > On Wed, Aug 10, 2011 at 11:09 PM, Anders Hammar >> wrote: >> > >> >> I agree with Stephen. The issues come from the fact that the ant job >> does >> >> too much, i.e. both generates the classes and compiles them. I have had >> my >> >> fair share of these issues using tools in Maven which originated from >> Ant >> >> land. Maven has a different approach. >> >> One possible half-way approach is to stay with the antrun plugin to >> >> generate >> >> the Java classes and bind that to the correct phase, and then use the >> >> compiler plugin to compile them. (But do understand that this will >> still >> >> cause you headache should you try to use m2eclipse v1.0+, as it will >> not >> >> know how to treat the antrun execution. It is then much better to have >> >> specific plugin for the code generation.) >> >> >> >>
Re: MAVEN version 2.2.1 and maven-antrun-plugin 1.6 want to compile classes with Java 1.4.2 version
Hi Wayne, We can't move all projects to MAVEN at this moment so idea is to convert some projects from ANT to MAVEN and slowly slowly we can implement or convert all project from ANT to MAVEN. So this is just a start and to make people happy. I know this is not realistic solution but have to do it. Thanks, daivish. On Thu, Aug 11, 2011 at 9:48 AM, Wayne Fay wrote: > > I can't apply JAVAC in my BUILD.XML as i am using Weblogic Workshop > related > > .WORK file under my build.xml and there is no way to specify JAVAC for > this > > wlwBuild Command. > > There *are* projects where Maven is simply unsuited for the task at > hand (or using Maven simply overcomplicates things without a > significant improvement in the build process) and you really should > just stick with your existing build process. > > This may be one of them. Why are you trying to migrate away from Ant > for this specific project? > > Wayne > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >
Re: MAVEN version 2.2.1 and maven-antrun-plugin 1.6 want to compile classes with Java 1.4.2 version
HI Stephen, Use http://mojo.codehaus.org/exec-maven-plugin/exec-mojo.html to run ANT and you can provide the ENV variables to your hearts content. For this can you give me example how can i setup JAVA_HOME by using exec-maven-plugin ? I think I can apply "ant -f WPSEjb_build.xml build" command in this plugin. But please let me know how can i setup My JAVA_HOME here ? Thanks for your help Stephen. thanks, daivish. On Thu, Aug 11, 2011 at 9:10 AM, Stephen Connolly < stephen.alan.conno...@gmail.com> wrote: > Use http://mojo.codehaus.org/exec-maven-plugin/exec-mojo.html to run > ANT and you can provide the ENV variables to your hearts content. > > Or use the http://ant.apache.org/manual/Tasks/exec.html to fork ANT > with the correct environment variables set. > > On 11 August 2011 17:06, Daivish Shah wrote: > > Hi Barrie, > > > > I can't apply JAVAC in my BUILD.XML as i am using Weblogic Workshop > related > > .WORK file under my build.xml and there is no way to specify JAVAC for > this > > wlwBuild Command. > > > > My code for build.xml is something like this. > > > > > > > > > > > > > > > > > > > > > > > > > > value="${java.home}/jre/lib/rt.jar;${java.home}/lib/tools.jar;${weblogic.home}/server/lib/knex.jar;${weblogic.home}/common/lib/log4j.jar;${weblogic.home}/server/lib/debugging.jar;${weblogic.home}/javelin/lib/javelin.jar;${weblogic.home}/server/lib/wlw-lang.jar;${weblogic.home}/server/lib/weblogic.jar;${weblogic.home}/common/eval/pointbase/lib/pbserver44.jar;${weblogic.home}/common/eval/pointbase/lib/pbclient44.jar;${weblogic.home}/server/lib/webservices.jar;${weblogic.home}/server/lib/webserviceclient.jar;${weblogic.home}/server/lib/webserviceclient+ssl.jar;${weblogic.home}/server/lib/wli.jar;${weblogic.home}/server/lib/xbean.jar;${weblogic.home}/server/lib/wlxbean.jar;${weblogic.home}/server/lib/xqrl.jar;${weblogic.home}/server/lib/netui/netui-compiler.jar;${mit.classpath}"/> > > > > > > > classpath="${weblogic.home}/workshop/wlw-ide.jar"/> > > > > > > > > > > > > > > > > > > > > > > > serverclasspath="${server.classpath}"> > > > > > > > > > > > > I can't use this plugin > > http://mojo.codehaus.org/exec-maven-plugin/index.html As i have > limitation > > to USE > generated my class files with all information in .WORK file of my > project. > > > > > > So i am not sure how can i apply MAVEN ANT Plugin to compile with java > > version 1.4.2, I am really struggling to get the answer on this. And i am > > stuck here. > > > > But i assume that you can provide compiler information in > > maven-antrun-plugin to execute your build.xml which is not possible with > > plugin. That's real limitation to use this plugin i guess. > > > > Please advice me some work around for my problem. > > > > Thanks, > > daivish. > > > > > > > > > > On Wed, Aug 10, 2011 at 11:09 PM, Anders Hammar > wrote: > > > >> I agree with Stephen. The issues come from the fact that the ant job > does > >> too much, i.e. both generates the classes and compiles them. I have had > my > >> fair share of these issues using tools in Maven which originated from > Ant > >> land. Maven has a different approach. > >> One possible half-way approach is to stay with the antrun plugin to > >> generate > >> the Java classes and bind that to the correct phase, and then use the > >> compiler plugin to compile them. (But do understand that this will still > >> cause you headache should you try to use m2eclipse v1.0+, as it will not > >> know how to treat the antrun execution. It is then much better to have > >> specific plugin for the code generation.) > >> > >> /Anders > >> > >> On Thu, Aug 11, 2011 at 07:45, Stephen Connolly < > >> stephen.alan.conno...@gmail.com> wrote: > >> > >> > sounds like he'd be better off pitching the ant build for a full maven > >> > build > >> > and using toolchains to get m-compiler-p compiling with 1.4... or > >> pitching > >> > maven and using ant. > >> > > >> > - Stephen > >> > > >> > --- > >> > Sent from my Android phone, so random spelling mistakes, random > nonsense > >> > words and other nonsense are a direct result of using swype to type on > >> the > >> > screen > >> > On 11 Aug 2011 05:23, "Barrie Treloar" wrote: > >> > > On Thu, Aug 11, 2011 at 9:47 AM, Daivish Shah < > daivish.s...@gmail.com> > >> > wrote: > >> > >> Hi, > >> > >> > >> > >> I tried giving JRE and TOOLS JAR from build.xml file. But it's > working > >> > fine > >> > >> if i run as ANT script. > >> > >> > >> > >> But when i execute as MAVEN it's taking JAVA_HOME variable which is > >> > setup > >> > as > >> > >> system variable so my system JAVA_HOME is 1.5 and i want to compile > >> with > >> > >> 1.4.2 from MAVEN Only. > >> > >> > >> > >> Even i gave dependencies as below. > >> > >> > >> > >> > >> > >> > >> > >>sun.jdk > >> > >>tools > >> > >>1.4.2 > >> > >
Re: MAVEN version 2.2.1 and maven-antrun-plugin 1.6 want to compile classes with Java 1.4.2 version
> I can't apply JAVAC in my BUILD.XML as i am using Weblogic Workshop related > .WORK file under my build.xml and there is no way to specify JAVAC for this > wlwBuild Command. There *are* projects where Maven is simply unsuited for the task at hand (or using Maven simply overcomplicates things without a significant improvement in the build process) and you really should just stick with your existing build process. This may be one of them. Why are you trying to migrate away from Ant for this specific project? Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: MAVEN version 2.2.1 and maven-antrun-plugin 1.6 want to compile classes with Java 1.4.2 version
Use http://mojo.codehaus.org/exec-maven-plugin/exec-mojo.html to run ANT and you can provide the ENV variables to your hearts content. Or use the http://ant.apache.org/manual/Tasks/exec.html to fork ANT with the correct environment variables set. On 11 August 2011 17:06, Daivish Shah wrote: > Hi Barrie, > > I can't apply JAVAC in my BUILD.XML as i am using Weblogic Workshop related > .WORK file under my build.xml and there is no way to specify JAVAC for this > wlwBuild Command. > > My code for build.xml is something like this. > > > > > > > > > > > > value="${java.home}/jre/lib/rt.jar;${java.home}/lib/tools.jar;${weblogic.home}/server/lib/knex.jar;${weblogic.home}/common/lib/log4j.jar;${weblogic.home}/server/lib/debugging.jar;${weblogic.home}/javelin/lib/javelin.jar;${weblogic.home}/server/lib/wlw-lang.jar;${weblogic.home}/server/lib/weblogic.jar;${weblogic.home}/common/eval/pointbase/lib/pbserver44.jar;${weblogic.home}/common/eval/pointbase/lib/pbclient44.jar;${weblogic.home}/server/lib/webservices.jar;${weblogic.home}/server/lib/webserviceclient.jar;${weblogic.home}/server/lib/webserviceclient+ssl.jar;${weblogic.home}/server/lib/wli.jar;${weblogic.home}/server/lib/xbean.jar;${weblogic.home}/server/lib/wlxbean.jar;${weblogic.home}/server/lib/xqrl.jar;${weblogic.home}/server/lib/netui/netui-compiler.jar;${mit.classpath}"/> > > > classpath="${weblogic.home}/workshop/wlw-ide.jar"/> > > > > > > > > > > > serverclasspath="${server.classpath}"> > > > > > > I can't use this plugin > http://mojo.codehaus.org/exec-maven-plugin/index.html As i have limitation > to USE generated my class files with all information in .WORK file of my project. > > > So i am not sure how can i apply MAVEN ANT Plugin to compile with java > version 1.4.2, I am really struggling to get the answer on this. And i am > stuck here. > > But i assume that you can provide compiler information in > maven-antrun-plugin to execute your build.xml which is not possible with > plugin. That's real limitation to use this plugin i guess. > > Please advice me some work around for my problem. > > Thanks, > daivish. > > > > > On Wed, Aug 10, 2011 at 11:09 PM, Anders Hammar wrote: > >> I agree with Stephen. The issues come from the fact that the ant job does >> too much, i.e. both generates the classes and compiles them. I have had my >> fair share of these issues using tools in Maven which originated from Ant >> land. Maven has a different approach. >> One possible half-way approach is to stay with the antrun plugin to >> generate >> the Java classes and bind that to the correct phase, and then use the >> compiler plugin to compile them. (But do understand that this will still >> cause you headache should you try to use m2eclipse v1.0+, as it will not >> know how to treat the antrun execution. It is then much better to have >> specific plugin for the code generation.) >> >> /Anders >> >> On Thu, Aug 11, 2011 at 07:45, Stephen Connolly < >> stephen.alan.conno...@gmail.com> wrote: >> >> > sounds like he'd be better off pitching the ant build for a full maven >> > build >> > and using toolchains to get m-compiler-p compiling with 1.4... or >> pitching >> > maven and using ant. >> > >> > - Stephen >> > >> > --- >> > Sent from my Android phone, so random spelling mistakes, random nonsense >> > words and other nonsense are a direct result of using swype to type on >> the >> > screen >> > On 11 Aug 2011 05:23, "Barrie Treloar" wrote: >> > > On Thu, Aug 11, 2011 at 9:47 AM, Daivish Shah >> > wrote: >> > >> Hi, >> > >> >> > >> I tried giving JRE and TOOLS JAR from build.xml file. But it's working >> > fine >> > >> if i run as ANT script. >> > >> >> > >> But when i execute as MAVEN it's taking JAVA_HOME variable which is >> > setup >> > as >> > >> system variable so my system JAVA_HOME is 1.5 and i want to compile >> with >> > >> 1.4.2 from MAVEN Only. >> > >> >> > >> Even i gave dependencies as below. >> > >> >> > >> >> > >> >> > >> sun.jdk >> > >> tools >> > >> 1.4.2 >> > >> system >> > >> >> > ${java.home}/lib/tools.jar >> > >> >> > >> >> > >> com.sun >> > >> rt >> > >> 1.4.2 >> > >> system >> > >> >> > ${java.home}/jre/lib/rt.jar >> > >> >> > >> >> > >> >> > >> >> > >> And Also tried giving something like this. >> > >> >> > >> >> > >> ${java.home} >> > >> ${java-version} >> > >> 1.4.2 >> > >> >> > >> >> > >> But it's still taking JDK 1.5 while compiling the source Code. >> > > >> > > Ant is just a java program. >> > > It doesn't use classpath dependencies
Re: MAVEN version 2.2.1 and maven-antrun-plugin 1.6 want to compile classes with Java 1.4.2 version
Hi Barrie, I can't apply JAVAC in my BUILD.XML as i am using Weblogic Workshop related .WORK file under my build.xml and there is no way to specify JAVAC for this wlwBuild Command. My code for build.xml is something like this. I can't use this plugin http://mojo.codehaus.org/exec-maven-plugin/index.html As i have limitation to USE wrote: > I agree with Stephen. The issues come from the fact that the ant job does > too much, i.e. both generates the classes and compiles them. I have had my > fair share of these issues using tools in Maven which originated from Ant > land. Maven has a different approach. > One possible half-way approach is to stay with the antrun plugin to > generate > the Java classes and bind that to the correct phase, and then use the > compiler plugin to compile them. (But do understand that this will still > cause you headache should you try to use m2eclipse v1.0+, as it will not > know how to treat the antrun execution. It is then much better to have > specific plugin for the code generation.) > > /Anders > > On Thu, Aug 11, 2011 at 07:45, Stephen Connolly < > stephen.alan.conno...@gmail.com> wrote: > > > sounds like he'd be better off pitching the ant build for a full maven > > build > > and using toolchains to get m-compiler-p compiling with 1.4... or > pitching > > maven and using ant. > > > > - Stephen > > > > --- > > Sent from my Android phone, so random spelling mistakes, random nonsense > > words and other nonsense are a direct result of using swype to type on > the > > screen > > On 11 Aug 2011 05:23, "Barrie Treloar" wrote: > > > On Thu, Aug 11, 2011 at 9:47 AM, Daivish Shah > > wrote: > > >> Hi, > > >> > > >> I tried giving JRE and TOOLS JAR from build.xml file. But it's working > > fine > > >> if i run as ANT script. > > >> > > >> But when i execute as MAVEN it's taking JAVA_HOME variable which is > > setup > > as > > >> system variable so my system JAVA_HOME is 1.5 and i want to compile > with > > >> 1.4.2 from MAVEN Only. > > >> > > >> Even i gave dependencies as below. > > >> > > >> > > >> > > >>sun.jdk > > >>tools > > >>1.4.2 > > >>system > > >> > > ${java.home}/lib/tools.jar > > >> > > >> > > >>com.sun > > >>rt > > >>1.4.2 > > >>system > > >> > > ${java.home}/jre/lib/rt.jar > > >> > > >> > > >> > > >> > > >> And Also tried giving something like this. > > >> > > >> > > >>${java.home} > > >>${java-version} > > >>1.4.2 > > >> > > >> > > >> But it's still taking JDK 1.5 while compiling the source Code. > > > > > > Ant is just a java program. > > > It doesn't use classpath dependencies or environment variables in > > > order to run. > > > Yes they are set in the bat files that startup Ant but not the java > Main > > class. > > > Ant expects all this stuff to be already available, so attempting to > > > get maven-antrun-plugin to inject these into the instance of Ant and > > > expecting it to work is a misunderstanding. > > > > > > Did you try any of the options I previously proposed? > > > > > > Another option is to just use the exec-maven-plugin > > > (http://mojo.codehaus.org/exec-maven-plugin) to exec Ant. > > > But then why are bothering to wrap all this in Maven? > > > > > > - > > > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > > > For additional commands, e-mail: users-h...@maven.apache.org > > > > > >
Re: MAVEN version 2.2.1 and maven-antrun-plugin 1.6 want to compile classes with Java 1.4.2 version
I agree with Stephen. The issues come from the fact that the ant job does too much, i.e. both generates the classes and compiles them. I have had my fair share of these issues using tools in Maven which originated from Ant land. Maven has a different approach. One possible half-way approach is to stay with the antrun plugin to generate the Java classes and bind that to the correct phase, and then use the compiler plugin to compile them. (But do understand that this will still cause you headache should you try to use m2eclipse v1.0+, as it will not know how to treat the antrun execution. It is then much better to have specific plugin for the code generation.) /Anders On Thu, Aug 11, 2011 at 07:45, Stephen Connolly < stephen.alan.conno...@gmail.com> wrote: > sounds like he'd be better off pitching the ant build for a full maven > build > and using toolchains to get m-compiler-p compiling with 1.4... or pitching > maven and using ant. > > - Stephen > > --- > Sent from my Android phone, so random spelling mistakes, random nonsense > words and other nonsense are a direct result of using swype to type on the > screen > On 11 Aug 2011 05:23, "Barrie Treloar" wrote: > > On Thu, Aug 11, 2011 at 9:47 AM, Daivish Shah > wrote: > >> Hi, > >> > >> I tried giving JRE and TOOLS JAR from build.xml file. But it's working > fine > >> if i run as ANT script. > >> > >> But when i execute as MAVEN it's taking JAVA_HOME variable which is > setup > as > >> system variable so my system JAVA_HOME is 1.5 and i want to compile with > >> 1.4.2 from MAVEN Only. > >> > >> Even i gave dependencies as below. > >> > >> > >> > >>sun.jdk > >>tools > >>1.4.2 > >>system > >> > ${java.home}/lib/tools.jar > >> > >> > >>com.sun > >>rt > >>1.4.2 > >>system > >> > ${java.home}/jre/lib/rt.jar > >> > >> > >> > >> > >> And Also tried giving something like this. > >> > >> > >>${java.home} > >>${java-version} > >>1.4.2 > >> > >> > >> But it's still taking JDK 1.5 while compiling the source Code. > > > > Ant is just a java program. > > It doesn't use classpath dependencies or environment variables in > > order to run. > > Yes they are set in the bat files that startup Ant but not the java Main > class. > > Ant expects all this stuff to be already available, so attempting to > > get maven-antrun-plugin to inject these into the instance of Ant and > > expecting it to work is a misunderstanding. > > > > Did you try any of the options I previously proposed? > > > > Another option is to just use the exec-maven-plugin > > (http://mojo.codehaus.org/exec-maven-plugin) to exec Ant. > > But then why are bothering to wrap all this in Maven? > > > > - > > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > > For additional commands, e-mail: users-h...@maven.apache.org > > >
Re: MAVEN version 2.2.1 and maven-antrun-plugin 1.6 want to compile classes with Java 1.4.2 version
sounds like he'd be better off pitching the ant build for a full maven build and using toolchains to get m-compiler-p compiling with 1.4... or pitching maven and using ant. - Stephen --- Sent from my Android phone, so random spelling mistakes, random nonsense words and other nonsense are a direct result of using swype to type on the screen On 11 Aug 2011 05:23, "Barrie Treloar" wrote: > On Thu, Aug 11, 2011 at 9:47 AM, Daivish Shah wrote: >> Hi, >> >> I tried giving JRE and TOOLS JAR from build.xml file. But it's working fine >> if i run as ANT script. >> >> But when i execute as MAVEN it's taking JAVA_HOME variable which is setup as >> system variable so my system JAVA_HOME is 1.5 and i want to compile with >> 1.4.2 from MAVEN Only. >> >> Even i gave dependencies as below. >> >> >> >>sun.jdk >>tools >>1.4.2 >>system >> ${java.home}/lib/tools.jar >> >> >>com.sun >>rt >>1.4.2 >>system >> ${java.home}/jre/lib/rt.jar >> >> >> >> >> And Also tried giving something like this. >> >> >>${java.home} >>${java-version} >>1.4.2 >> >> >> But it's still taking JDK 1.5 while compiling the source Code. > > Ant is just a java program. > It doesn't use classpath dependencies or environment variables in > order to run. > Yes they are set in the bat files that startup Ant but not the java Main class. > Ant expects all this stuff to be already available, so attempting to > get maven-antrun-plugin to inject these into the instance of Ant and > expecting it to work is a misunderstanding. > > Did you try any of the options I previously proposed? > > Another option is to just use the exec-maven-plugin > (http://mojo.codehaus.org/exec-maven-plugin) to exec Ant. > But then why are bothering to wrap all this in Maven? > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org >
Re: MAVEN version 2.2.1 and maven-antrun-plugin 1.6 want to compile classes with Java 1.4.2 version
On Thu, Aug 11, 2011 at 9:47 AM, Daivish Shah wrote: > Hi, > > I tried giving JRE and TOOLS JAR from build.xml file. But it's working fine > if i run as ANT script. > > But when i execute as MAVEN it's taking JAVA_HOME variable which is setup as > system variable so my system JAVA_HOME is 1.5 and i want to compile with > 1.4.2 from MAVEN Only. > > Even i gave dependencies as below. > > > > sun.jdk > tools > 1.4.2 > system > ${java.home}/lib/tools.jar > > > com.sun > rt > 1.4.2 > system > ${java.home}/jre/lib/rt.jar > > > > > And Also tried giving something like this. > > > ${java.home} > ${java-version} > 1.4.2 > > > But it's still taking JDK 1.5 while compiling the source Code. Ant is just a java program. It doesn't use classpath dependencies or environment variables in order to run. Yes they are set in the bat files that startup Ant but not the java Main class. Ant expects all this stuff to be already available, so attempting to get maven-antrun-plugin to inject these into the instance of Ant and expecting it to work is a misunderstanding. Did you try any of the options I previously proposed? Another option is to just use the exec-maven-plugin (http://mojo.codehaus.org/exec-maven-plugin) to exec Ant. But then why are bothering to wrap all this in Maven? - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: MAVEN version 2.2.1 and maven-antrun-plugin 1.6 want to compile classes with Java 1.4.2 version
Hi, I tried giving JRE and TOOLS JAR from build.xml file. But it's working fine if i run as ANT script. But when i execute as MAVEN it's taking JAVA_HOME variable which is setup as system variable so my system JAVA_HOME is 1.5 and i want to compile with 1.4.2 from MAVEN Only. Even i gave dependencies as below. sun.jdk tools 1.4.2 system ${java.home}/lib/tools.jar com.sun rt 1.4.2 system ${java.home}/jre/lib/rt.jar And Also tried giving something like this. ${java.home} ${java-version} 1.4.2 But it's still taking JDK 1.5 while compiling the source Code. Please advice me. Thanks, daivish. On Wed, Aug 10, 2011 at 4:58 PM, Barrie Treloar wrote: > On Thu, Aug 11, 2011 at 9:01 AM, Daivish Shah > wrote: > > I'm using an ant build.xml that generates classes and compiles them with > the > > tools.jar from the JDK. > > > > I am using MAVEN 2.2.1 version. JDK 1.5 to execute MAVEN. As maven 2.2.1 > > version supports higher then JDK 1.5 only so I have to use it. > > You can downgrade to Maven 2.0.11 > (http://maven.apache.org/docs/2.0.11/release-notes.html) which will > support 1.4. > > > This maven-antrun-plugin doesn't allow to specify neither source or > target > > version for the compiler. > > So, the generated classes are compiled against the currently running JVM > > which is JDK , using its rt.jar and the tools.jar provided in plugin > > dependencies (or placed in the lib/ext directory of the jvm). > > > > As Maven is executed in a 1.5 JVM (jdk1.5.0_22) is needed for my project > to > > compile these classes with JDK 1.4.2 version because the server where I > want > > to deploy them is running on a 1.4 JVM, so I am getting exception while I > am > > compiling with MAVEN plugin from my eclipse or command line. > > > > I couldn't find a way to tell antrun to compile my classes using a > different > > java version. > > I tried the following workarounds : > > You can upgrade WPS to use java 1.5. > > Or you can tell Ant to use a different version of java. > http://ant.apache.org/manual/Tasks/javac.html > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >
Re: MAVEN version 2.2.1 and maven-antrun-plugin 1.6 want to compile classes with Java 1.4.2 version
On Thu, Aug 11, 2011 at 9:01 AM, Daivish Shah wrote: > I'm using an ant build.xml that generates classes and compiles them with the > tools.jar from the JDK. > > I am using MAVEN 2.2.1 version. JDK 1.5 to execute MAVEN. As maven 2.2.1 > version supports higher then JDK 1.5 only so I have to use it. You can downgrade to Maven 2.0.11 (http://maven.apache.org/docs/2.0.11/release-notes.html) which will support 1.4. > This maven-antrun-plugin doesn't allow to specify neither source or target > version for the compiler. > So, the generated classes are compiled against the currently running JVM > which is JDK , using its rt.jar and the tools.jar provided in plugin > dependencies (or placed in the lib/ext directory of the jvm). > > As Maven is executed in a 1.5 JVM (jdk1.5.0_22) is needed for my project to > compile these classes with JDK 1.4.2 version because the server where I want > to deploy them is running on a 1.4 JVM, so I am getting exception while I am > compiling with MAVEN plugin from my eclipse or command line. > > I couldn't find a way to tell antrun to compile my classes using a different > java version. > I tried the following workarounds : You can upgrade WPS to use java 1.5. Or you can tell Ant to use a different version of java. http://ant.apache.org/manual/Tasks/javac.html - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
MAVEN version 2.2.1 and maven-antrun-plugin 1.6 want to compile classes with Java 1.4.2 version
I'm using an ant build.xml that generates classes and compiles them with the tools.jar from the JDK. I am using MAVEN 2.2.1 version. JDK 1.5 to execute MAVEN. As maven 2.2.1 version supports higher then JDK 1.5 only so I have to use it. This maven-antrun-plugin doesn't allow to specify neither source or target version for the compiler. So, the generated classes are compiled against the currently running JVM which is JDK , using its rt.jar and the tools.jar provided in plugin dependencies (or placed in the lib/ext directory of the jvm). As Maven is executed in a 1.5 JVM (jdk1.5.0_22) is needed for my project to compile these classes with JDK 1.4.2 version because the server where I want to deploy them is running on a 1.4 JVM, so I am getting exception while I am compiling with MAVEN plugin from my eclipse or command line. I couldn't find a way to tell antrun to compile my classes using a different java version. I tried the following workarounds : change the tools.jar dependency to point to a 1.4 version => as the compiler uses the rt.jar from the currently running 1.5 JVM, the class file version doesn't match (version 49.0, expecting 48.0) add a dependency to a 1.4 rt.jar => it doesn't change anything, as the rt.jar should be specified in the boot classpath. Following one is the sample code which i am using. org.apache.maven.plugins maven-antrun-plugin 1.6 install install run ${java-version} ${java-version} ${java-version} ${java.home}/lib/tools.jar ${java.home}/jre/lib/rt.jar crimson crimson 1.1.3 sun.jdk tools 1.4.2 system ${java.home}/lib/tools.jar com.sun rt ${java-version} system ${java.home}/jre/lib/rt.jar I am getting exceptions something like this. WPSClient.java:22: cannot access java.lang.Object [wlwBuild] [Build] bad class file: C:\Java\jdk1.5.0_22\jre\lib\rt.jar(java/lang/Object.class) [wlwBuild] [Build] class file has wrong version 49.0, should be 48.0 [wlwBuild] [Build] Please remove or make sure it appears in the correct subdirectory of the classpath. [wlwBuild] [Build] public static WPSServerRemote getWPSServer() throws MitchellException { [wlwBuild] [Build] ^ [wlwBuild] [Build] 3 errors [wlwBuild] [Build] BUILD FAILED [wlwBuild] [Build] Compile failed; see the compiler error output for details. [wlwBuild] [Build] [wlwBuild] java.lang.reflect.InvocationTargetException [wlwBuild] java.lang.reflect.InvocationTargetException [wlwBuild] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [wlwBuild] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [wlwBuild] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [wlwBuild] at java.lang.reflect.Method.invoke(Method.java:592) [wlwBuild] at workshop.core.Compile.start(Compile.java:19) [wlwBuild] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [wlwBuild] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [wlwBuild] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [wlwBuild] at java.lang.reflect.Method.invoke(Method.java:592) [wlwBuild] at workshop.core.Starter.invokeStart(Starter.java:34) [wlwBuild] at workshop.core.Compile.main(Compile.java:9) [wlwBuild] Caused by: java.lang.NoClassDefFoundError: org/apache/crimson/tree/XmlDocument [wlwBuild] at workshop.util.ide.PreferencesNode._export(PreferencesNode.java:540) [wlwBuild] at workshop.util.ide.PreferencesNode.exportSubtree(PreferencesNode.java:820) [wlwBuild] at workshop.util.ide.PreferencesNode.flush(PreferencesNode.java:984) [wlwBuild] at workshop.core.App$15.run(App.java:1000) [wlwBuild] at workshop.core.asynctask.AsyncTaskManager.showDialogWhileRunning(AsyncTaskManager.java:272) [wlwBuild] at workshop.core.asynctask.AsyncTaskManager.showDialogWhileRunning(AsyncTaskManager.java:482) [wlwBuild] at workshop.core.App.exit(App.java:994) [wlwBuild] at workshop.core.CompileHelper.compile(CompileHelper.java:298) Please let me know HOW CAN I SETUP JDK 1.4.2 Version to Compile my classes by using maven-antrun-plugin.