Return-Path: X-Original-To: apmail-maven-users-archive@www.apache.org Delivered-To: apmail-maven-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 13EA57699 for ; Thu, 11 Aug 2011 17:01:09 +0000 (UTC) Received: (qmail 95089 invoked by uid 500); 11 Aug 2011 17:01:06 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 95013 invoked by uid 500); 11 Aug 2011 17:01:05 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 95005 invoked by uid 99); 11 Aug 2011 17:01:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Aug 2011 17:01:05 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of daivish.shah@gmail.com designates 74.125.82.43 as permitted sender) Received: from [74.125.82.43] (HELO mail-ww0-f43.google.com) (74.125.82.43) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Aug 2011 17:01:00 +0000 Received: by wwe32 with SMTP id 32so1984620wwe.24 for ; Thu, 11 Aug 2011 10:00:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=OxG2ATk7wMVkKmMi7Kvi3+9aosTXV4rNxpSOtLLSW4w=; b=dGWNNQSTsop/PcJUTA7BZ2yty8BI6MSL0hxoND1NGeUqQI8NTCPW7Ag27eKxkT6KFl OV4MTv3zaEYo3a8qEDFVkfDjWAFet9+xiJ1xyAKpvXcjW3CYInKuuqKVgHuzIWxh1SjL TX9iR3PBLwsYnWUpCzEC9hM90vkxl8YPFL2rY= MIME-Version: 1.0 Received: by 10.216.133.197 with SMTP id q47mr1911050wei.90.1313082038779; Thu, 11 Aug 2011 10:00:38 -0700 (PDT) Received: by 10.216.23.9 with HTTP; Thu, 11 Aug 2011 10:00:38 -0700 (PDT) In-Reply-To: References: Date: Thu, 11 Aug 2011 10:00:38 -0700 Message-ID: Subject: Re: MAVEN version 2.2.1 and maven-antrun-plugin 1.6 want to compile classes with Java 1.4.2 version From: Daivish Shah To: Maven Users List Content-Type: multipart/alternative; boundary=00504502e1b37b807b04aa3dbcc4 --00504502e1b37b807b04aa3dbcc4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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_HOM= E here ? Thanks for your help Stephen. thanks, daivish. On Thu, Aug 11, 2011 at 9:10 AM, Stephen Connolly < stephen.alan.connolly@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=3D"${java.home}/jre/lib/rt.jar;${java.home}/lib/tools.jar;${weblogi= c.home}/server/lib/knex.jar;${weblogic.home}/common/lib/log4j.jar;${weblogi= c.home}/server/lib/debugging.jar;${weblogic.home}/javelin/lib/javelin.jar;$= {weblogic.home}/server/lib/wlw-lang.jar;${weblogic.home}/server/lib/weblogi= c.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/wlxbe= an.jar;${weblogic.home}/server/lib/xqrl.jar;${weblogic.home}/server/lib/net= ui/netui-compiler.jar;${mit.classpath}"/> > > > > > > > classpath=3D"${weblogic.home}/workshop/wlw-ide.jar"/> > > > > > > > > > > > > > > > > > > > > > > > serverclasspath=3D"${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 wit= h > > 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 ha= d > 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 sti= ll > >> cause you headache should you try to use m2eclipse v1.0+, as it will n= ot > >> 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.connolly@gmail.com> wrote: > >> > >> > sounds like he'd be better off pitching the ant build for a full mav= en > >> > 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.shah@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 compi= le > >> 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 jav= a > >> 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 a= nd > >> > > 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-unsubscribe@maven.apache.org > >> > > For additional commands, e-mail: users-help@maven.apache.org > >> > > > >> > > >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org > For additional commands, e-mail: users-help@maven.apache.org > > --00504502e1b37b807b04aa3dbcc4--