If my experience with the weblogic plugin is anything to go by, you need to add this as an ant plugin dependency:

          <dependency>
            <groupId>sun.jdk</groupId>
            <artifactId>tools</artifactId>
            <version>1.4.2</version>
            <scope>system</scope>
            <systemPath>${java.home}/../lib/tools.jar</systemPath>
          </dependency>

Use an appropriate version of course. For some reason, ${java.home} gets set to the JRE by maven, even when $JAVA_HOME is pointing at a JDK.

Steve C.


On 28/12/2006, at 10:04 AM, Lee Meador wrote:

This part:

Embedded error: The following error occurred while executing this line:
E:\work\LTY-P000039\frontoffice\ltyApp\source\build.xml:685: Unable to
find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
[INFO]

suggests that your JAVA_HOME environment variable is not pointing to a java JDK. Sometimes it gets set to point to a JRE instead. You should check the
variable.

I think ANT needs it in line 685 in your build.xml. This is the
build.xmlthat you reference from the <ant> task inside the <tasks> tag
under the
antrun plugin.

-- Lee


On 12/22/06, EJ Ciramella <[EMAIL PROTECTED]> wrote:

Has anyone tried using the <ant> task inside of maven2?

We're trying to run a full ant based build inside of maven 2 (which
includes a compile) but we're getting the following error:

    [javac] Compiling 752 source files to
E:\work\LTY-P000039\frontoffice\ltyApp\build\config\site\classes
[INFO]
--------------------------------------------------------------------- ---
[ERROR] BUILD ERROR
[INFO]
--------------------------------------------------------------------- ---
[INFO] Error executing ant tasks

Embedded error: The following error occurred while executing this line: E:\work\LTY-P000039\frontoffice\ltyApp\source\build.xml:685: Unable to
find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
[INFO]
--------------------------------------------------------------------- ---
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error executing
ant tasks
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (Default
LifecycleExecutor.java:559)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi fec
ycle(DefaultLifecycleExecutor.java:475)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultL
ifecycleExecutor.java:454)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan dle
Failures(DefaultLifecycleExecutor.java:306)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen ts(
DefaultLifecycleExecutor.java:273)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLifec
ycleExecutor.java:140)
        at
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java: 115)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.jav
a:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessor
Impl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java: 255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error
executing ant tasks
        at
org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks (AbstractAntM
ojo.java:114)
        at
org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginMa
nager.java:412)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (Default
LifecycleExecutor.java:534)
        ... 16 more
Caused by: The following error occurred while executing this line:
E:\work\LTY-P000039\frontoffice\ltyApp\source\build.xml:685: Unable to
find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
        at
org.apache.tools.ant.ProjectHelper.addLocationToBuildException (ProjectHe
lper.java:539)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:384)
        at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at
org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks (AbstractAntM
ojo.java:108)
        ... 19 more
Caused by: E:\work\LTY-P000039\frontoffice\ltyApp\source\build.xml: 685:
Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
        at
org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCom pil
er(CompilerAdapterFactory.java:105)
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java: 924) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java: 757)
        at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets (SingleChe
ckExecutor.java:37)
        at
org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
        ... 23 more
[INFO]
--------------------------------------------------------------------- ---



Any suggestions?

(this works fine when doing a regular ant world-simple)




--
-- Lee Meador
Sent from gmail. My real email address is lee AT leemeador.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to