You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Luis Lopez <lo...@us.ibm.com> on 2013/05/09 21:52:01 UTC

maven-antrun-plugin and ant basedir question

Hi,

I am trying to do a custom build of Dojo using Maven and the Dojo supplied 
build.xml file.  I have managed to get most of the pieces that I need into 
the pom.xml file to where the ant clean task works and the default task 
starts.  Unfortunately the default task depends on the value of basedir 
which is set to "." at the top of the build.xml file (<project name="dojo" 
default="cldr" basedir=".">).  Since Maven is not running from the 
directory where the build.xml file is at, all the paths are wrong.  In my 
pom.xml file I have tried to override this value by adding, <property 
name="basedir" value="${dojo.cldr.location}"/>, <property name="basedir" 
location="${dojo.cldr.location}"/>, and <ant 
antfile="${dojo.cldr.build.xml}" dir="${dojo.cldr.location}" 
target="cldr"/>.  Setting basedir using a value or location does not seem 
to make any difference when I run the task.  When I set the dir attribute 
in the ant task I get the error below. 

So my questions are:
1) Does anybody know how to correctly override the Ant basedir value from 
Maven?
2) Is there a good tutorial/documentation out there on the 
maven-antrun-plugin? 

[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-antrun-plugin:1.7:run (default) on project 
dojo-assembly: An Ant BuildException has occured: The following error 
occurred while executing this line:
[ERROR] 
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\temp\dojo-release-1.8.1-src\util\buildscripts\cldr\build.xml:248: 
javax.script.ScriptException: 
sun.org.mozilla.javascript.internal.WrappedException: Wrapped The 
following error occurred while executing this line:
[ERROR] 
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\temp\dojo-release-1.8.1-src\util\buildscripts\cldr\build.xml:165: 
The following error occurred while executing this line:
[ERROR] 
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\temp\dojo-release-1.8.1-src\util\buildscripts\cldr\build.xml:178: 
java.lang.ClassNotFoundException: net.sf.saxon.TransformerFactoryImpl 
(<Unknown source>#52) in <Unknown source> at line number 52
[ERROR] around Ant part ...<ant target="cldr" 
antfile="C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly/target/temp/dojo-release-1.8.1-src/util/buildscripts/cldr/build.xml" 
dir="C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly/target/temp/dojo-release-1.8.1-src/util/buildscripts/cldr"/>... 
@ 9:259 in 
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\antrun\build-main.xml
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute 
goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (default) on 
project dojo-assembly: An Ant BuildException has occured: The following 
error occurred while executing this line:
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\temp\dojo-release-1.8.1-src\util\buildscripts\cldr\build.xml:248: 
javax.script.ScriptException: 
sun.org.mozilla.javascript.internal.WrappedException: Wrapped The 
following error occurred while executing this line:
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\temp\dojo-release-1.8.1-src\util\buildscripts\cldr\build.xml:165: 
The following error occurred while executing this line:
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\temp\dojo-release-1.8.1-src\util\buildscripts\cldr\build.xml:178: 
java.lang.ClassNotFoundException: net.sf.saxon.TransformerFactoryImpl 
(<Unknown source>#52) in <Unknown source> at line number 52
around Ant part ...<ant target="cldr" 
antfile="C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly/target/temp/dojo-release-1.8.1-src/util/buildscripts/cldr/build.xml" 
dir="C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly/target/temp/dojo-release-1.8.1-src/util/buildscripts/cldr"/>... 
@ 9:259 in 
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\antrun\build-main.xml
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at 
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at 
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:600)
        at 
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at 
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at 
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at 
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: An Ant 
BuildException has occured: The following error occurred while executing 
this line:
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\temp\dojo-release-1.8.1-src\util\buildscripts\cldr\build.xml:248: 
javax.script.ScriptException: 
sun.org.mozilla.javascript.internal.WrappedException: Wrapped The 
following error occurred while executing this line:
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\temp\dojo-release-1.8.1-src\util\buildscripts\cldr\build.xml:165: 
The following error occurred while executing this line:
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\temp\dojo-release-1.8.1-src\util\buildscripts\cldr\build.xml:178: 
java.lang.ClassNotFoundException: net.sf.saxon.TransformerFactoryImpl 
(<Unknown source>#52) in <Unknown source> at line number 52
around Ant part ...<ant target="cldr" 
antfile="C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly/target/temp/dojo-release-1.8.1-src/util/buildscripts/cldr/build.xml" 
dir="C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly/target/temp/dojo-release-1.8.1-src/util/buildscripts/cldr"/>... 
@ 9:259 in 
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\antrun\build-main.xml
        at 
org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:355)
        at 
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
Caused by: 
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\antrun\build-main.xml:9: 
The following error occurred while executing this line:
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\temp\dojo-release-1.8.1-src\util\buildscripts\cldr\build.xml:248: 
javax.script.ScriptException: 
sun.org.mozilla.javascript.internal.WrappedException: Wrapped The 
following error occurred while executing this line:
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\temp\dojo-release-1.8.1-src\util\buildscripts\cldr\build.xml:165: 
The following error occurred while executing this line:
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\temp\dojo-release-1.8.1-src\util\buildscripts\cldr\build.xml:178: 
java.lang.ClassNotFoundException: net.sf.saxon.TransformerFactoryImpl 
(<Unknown source>#52) in <Unknown source> at line number 52
        at 
org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:551)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:444)
        at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:600)
        at 
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at 
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at 
org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:327)
        ... 21 more
Caused by: 
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\temp\dojo-release-1.8.1-src\util\buildscripts\cldr\build.xml:248: 
javax.script.ScriptException: 
sun.org.mozilla.javascript.internal.WrappedException: Wrapped The 
following error occurred while executing this line:
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\temp\dojo-release-1.8.1-src\util\buildscripts\cldr\build.xml:165: 
The following error occurred while executing this line:
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\temp\dojo-release-1.8.1-src\util\buildscripts\cldr\build.xml:178: 
java.lang.ClassNotFoundException: net.sf.saxon.TransformerFactoryImpl 
(<Unknown source>#52) in <Unknown source> at line number 52
        at 
org.apache.tools.ant.util.ReflectUtil.toBuildException(ReflectUtil.java:183)
        at 
org.apache.tools.ant.util.ReflectUtil.throwBuildException(ReflectUtil.java:166)
        at 
org.apache.tools.ant.util.ReflectUtil.invoke(ReflectUtil.java:110)
        at 
org.apache.tools.ant.util.ReflectWrapper.invoke(ReflectWrapper.java:81)
        at 
org.apache.tools.ant.util.optional.JavaxScriptRunner.evaluateScript(JavaxScriptRunner.java:103)
        at 
org.apache.tools.ant.util.optional.JavaxScriptRunner.executeScript(JavaxScriptRunner.java:67)
        at 
org.apache.tools.ant.taskdefs.optional.script.ScriptDef.executeScript(ScriptDef.java:350)
        at 
org.apache.tools.ant.taskdefs.optional.script.ScriptDefBase.execute(ScriptDefBase.java:50)
        at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:600)
        at 
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at 
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at 
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
        ... 32 more
Caused by: javax.script.ScriptException: 
sun.org.mozilla.javascript.internal.WrappedException: Wrapped The 
following error occurred while executing this line:
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\temp\dojo-release-1.8.1-src\util\buildscripts\cldr\build.xml:165: 
The following error occurred while executing this line:
C:\appliocationDev\appliocation-1.0.0\xc.ui\dojo-assembly\target\temp\dojo-release-1.8.1-src\util\buildscripts\cldr\build.xml:178: 
java.lang.ClassNotFoundException: net.sf.saxon.TransformerFactoryImpl 
(<Unknown source>#52) in <Unknown source> at line number 52
        at 
com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:110)
        at 
com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:124)
        at 
javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:259)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:600)
        at 
org.apache.tools.ant.util.ReflectUtil.invoke(ReflectUtil.java:108)
        ... 49 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, 
please read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the 
command
[ERROR]   mvn <goals> -rf :dojo-assembly


Regards,
Luis F. López

Re: maven-antrun-plugin and ant basedir question

Posted by Wayne Fay <wa...@gmail.com>.
> The build.xml file is part of the Dojo distribution.  I would like to
> avoid modifying their files as Dojo is being updated all the time.  So

I strongly doubt their build.xml file is "being updated all the time."
I would just edit this one spot and then keep an eye for changes to
this file so you can merge them in.

> ideally I would like to be able to somehow pass the override value from
> Maven since I own that pom.xml file.  So that is my question.  How do I do
> that?  If I was running Ant directly I would just pass the value in the
> command line.  I have not been able to figure out how to do that in Maven.

If these links don't help (found with a simple Google search), then
what you want to do is probably not possible:
http://maven.40175.n5.nabble.com/M2-how-to-pass-maven-properties-to-ant-build-using-antrun-td81538.html
http://books.sonatype.com/mcookbook/reference/ch04s03.html
http://docs.codehaus.org/display/MAVENUSER/Antrun+Plugin
http://stackoverflow.com/questions/4040778/parent-properties-inside-maven-antrun-plugin

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven-antrun-plugin and ant basedir question

Posted by Luis Lopez <lo...@us.ibm.com>.
Wayne,

The build.xml file is part of the Dojo distribution.  I would like to 
avoid modifying their files as Dojo is being updated all the time.  So 
ideally I would like to be able to somehow pass the override value from 
Maven since I own that pom.xml file.  So that is my question.  How do I do 
that?  If I was running Ant directly I would just pass the value in the 
command line.  I have not been able to figure out how to do that in Maven.

Regards,
Luis F. López




From:   Wayne Fay <wa...@gmail.com>
To:     Maven Users List <us...@maven.apache.org>, 
Date:   05/09/2013 04:24 PM
Subject:        Re: maven-antrun-plugin and ant basedir question



> I am trying to do a custom build of Dojo using Maven and the Dojo 
supplied
> build.xml file.  I have managed to get most of the pieces that I need 
into
> the pom.xml file to where the ant clean task works and the default task
> starts.  Unfortunately the default task depends on the value of basedir
> which is set to "." at the top of the build.xml file (<project 
name="dojo"
> default="cldr" basedir=".">).  Since Maven is not running from the
> directory where the build.xml file is at, all the paths are wrong.  In 
my

Can you not simply edit the basedir="." directly in the build.xml file
itself to reflect the correct directory? Or set/override that value
using a parameter passed in from Maven, or passed via a system
setting, or read from a properties file... or something?

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org



Re: maven-antrun-plugin and ant basedir question

Posted by Wayne Fay <wa...@gmail.com>.
> I am trying to do a custom build of Dojo using Maven and the Dojo supplied
> build.xml file.  I have managed to get most of the pieces that I need into
> the pom.xml file to where the ant clean task works and the default task
> starts.  Unfortunately the default task depends on the value of basedir
> which is set to "." at the top of the build.xml file (<project name="dojo"
> default="cldr" basedir=".">).  Since Maven is not running from the
> directory where the build.xml file is at, all the paths are wrong.  In my

Can you not simply edit the basedir="." directly in the build.xml file
itself to reflect the correct directory? Or set/override that value
using a parameter passed in from Maven, or passed via a system
setting, or read from a properties file... or something?

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org