|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Hello,
I'm trying to run the following ant file: <project name="test" basedir="." default="test"> Code:
<macrodef name="testing">
<attribute name="v" default="NOT SET"/>
<sequential>
<echo>v is @{v}</echo>
</sequential>
</macrodef>
<target name="test">
<echo>start test</echo>
<testing v="This is v">
</testing>
<echo>end test</echo>
</target>
</project>
When running the task from the eclips, using ant plug in, the task is working succefully. Now I wrote a jave code, running under Jboss server, that run the task. And i'm having a problem with the MacroDef task (other tasks are working). I'm getting the error message: Code:
Unknown attribute [v] at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:382) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) at org.apache.tools.ant.Project.executeTarget(Project.java:1298) I'm guessing it sonething to do with diffrent Jars, but i couldn't find the diffrents. Thanks, |
|
#2
|
||||
|
||||
|
Quote:
It probably does. Ensure that you are using current versions of Ant in both environments. ~
__________________
Yawmark class Sig{public static void main(String...args){\u0066or(int \u0020$:"vÌÈÊ\"¤¾Àʲ¬Æ\"v¤Î¤\"²¤¨¸¬Æ".to\u0043h\u0061rArray() )System./*goto/*$/%\u0126//^\u002A\u002Fout.print((char)(($>> +(~'"'&'#'))+('<'>>('\\'/'.')/\u002Array.const(~1)\*\u002F)));}} |
|
#3
|
|||
|
|||
|
mabe you can be more specifc?
Do you know of an Ant version where the MacroDef is not working? What is the specific jar for this task? |
|
#4
|
|||||
|
|||||
|
Quote:
I don't know how to be more specific than "ensure you are using current versions of Ant in both environments." That sounds pretty specific to me. *shrugs* Quote:
The MacroDef task has been available since Ant 1.6, but is still apparently in beta. You can see this in the Ant documentation. Quote:
ant.jar ~ |
|
#5
|
|||
|
|||
|
Apperently there was no problem with the jars.
The problem was in the Java code parsing the Ant file. I used the code Code:
final ProjectHelper helper = new ProjectHelperImpl();
helper.parse(ant, new File("D:\\testAnt\\test2.xml"));
And I should have used: Code:
ProjectHelper.configureProject(ant, new File("D:\\testAnt\\test2.xml));
Hopefully this will help to someone else. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > ANT task macrodef - Error message: Unknown attribute |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|