HI Stephen,

I tried the way your way...

              <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2</version>
                <executions>
                  <execution>
                    <id>install</id>
                    <phase>install</phase>
                    <goals>
                      <goal>exec</goal>
                    </goals>
                  </execution>
                </executions>
                <configuration>
                  <executable>C:\test\WPSEjb.bat</executable>
                </configuration>
              </plugin>

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 <[email protected]>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 <
> [email protected]> 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 <[email protected]> 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.
>> >
>> >
>> > <?xml version="1.0" encoding="UTF-8" ?>
>> > <project name="WLW build" default="build">
>> >
>> >    <property file="local.properties" />
>> >    <property file="reference.properties" />
>> >
>> >    <property name="app.source.dir" value="C:\WPS" />
>> >    <property name="work.file"  value="WPS.work" />
>> >    <property name="output.dir" value="C:\TEST" />
>> >    <property name="server.classpath"
>> >
>> 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}"/>
>> >    <property environment="env" />
>> >    <property name="java.home" value="C:\bea\jdk142_04"/>
>> >    <taskdef name="wlwBuild" classname="workshop.core.WlwBuildTask"
>> > classpath="${weblogic.home}/workshop/wlw-ide.jar"/>
>> >
>> >  <!--target name="wbuild" depends="init"-->
>> >  <target name="build" depends="wbuild"/>
>> >
>> >  <target name="wbuild" >
>> >    <echo message="SourceDirectory=${app.source.dir}/${work.file}"/>
>> >     <echo message="output.dir=${output.dir}"/>
>> >     <echo message="server.classpath=${server.classpath}"/>
>> >     <echo message="env.JAVA_HOME=${env.JAVA_HOME}"/>
>> >
>> >    <wlwBuild work="${app.source.dir}/${work.file}"
>> > serverclasspath="${server.classpath}">
>> >        <build project="WPSEjb"/>
>> >    </wlwBuild>
>> >  </target>
>> > </project>
>> >
>> > I can't use this plugin
>> > http://mojo.codehaus.org/exec-maven-plugin/index.html As i have
>> limitation
>> > to USE <wlwBuild command from Build.xml as this is the only command
>> 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 <[email protected]>
>> 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 <
>> >> [email protected]> 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" <[email protected]> wrote:
>> >> > > On Thu, Aug 11, 2011 at 9:47 AM, Daivish Shah <
>> [email protected]>
>> >> > 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.
>> >> > >>
>> >> > >>                <dependencies>
>> >> > >>                    <dependency>
>> >> > >>                        <groupId>sun.jdk</groupId>
>> >> > >>                        <artifactId>tools</artifactId>
>> >> > >>                        <version>1.4.2</version>
>> >> > >>                        <scope>system</scope>
>> >> > >>
>> >> >  <systemPath>${java.home}/lib/tools.jar</systemPath>
>> >> > >>                    </dependency>
>> >> > >>                    <dependency>
>> >> > >>                        <groupId>com.sun</groupId>
>> >> > >>                        <artifactId>rt</artifactId>
>> >> > >>                        <version>1.4.2</version>
>> >> > >>                        <scope>system</scope>
>> >> > >>
>> >> >  <systemPath>${java.home}/jre/lib/rt.jar</systemPath>
>> >> > >>                    </dependency>
>> >> > >>                </dependencies>
>> >> > >>
>> >> > >>
>> >> > >> And Also tried giving something like this.
>> >> > >>
>> >> > >>                        <configuration>
>> >> > >>                            <javaHome>${java.home}</javaHome>
>> >> > >>                            <source>${java-version}</source>
>> >> > >>                            <target>1.4.2</target>
>> >> > >>                         </configuration>
>> >> > >>
>> >> > >> 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: [email protected]
>> >> > > For additional commands, e-mail: [email protected]
>> >> > >
>> >> >
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>

Reply via email to