這裏是我的構建文件:無法識別workspaceid在Ant4Eclipse
<project name="ant-in-eclipse" basedir="."
xmlns:ant4eclipse="antlib:org.ant4eclipse"
xmlns:antcontrib="antlib:net.sf.antcontrib" default="compileAndJar" >
<taskdef uri="antlib:net.sf.antcontrib"
resource="net/sf/antcontrib/antlib.xml" />
<!-- define ant4eclipse tasks -->
<taskdef uri="antlib:org.ant4eclipse"
resource="org/ant4eclipse/ant/antlib.xml" />
<import file="/data/temp/ANT/ANT4/macros/a4e-jdt-macros.xml"/>
<target name="compileAndJar">
<macrodef name="build">
<attribute name="workspaceDirectory" default="deploy" />
<sequential>
<echo>Hi</echo>
</sequential>
</macrodef>
<buildJdtProject workspaceDirectory="${workspaceDirectory}"
projectname="wfn-common.jar">
<finish>
<jar destfile="deploy/wfn-common.jar">
<ant4eclipse:jdtProjectFileSet destination="."
projectname="${buildJdtProject.project.name}" />
</jar>
</finish>
</buildJdtProject>
</target>
</project>
我收到此錯誤
/data/temp/ANT/PTO_Build/WFN_Framework/wfn-common/sample.xml:21: The following error occurred while executing this line:
/data/temp/ANT/ANT4/macros/a4e-jdt-macros.xml:105: ant4eclipse:executeJdtProject doesn't support the "workspaceid" attribute
at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:396)
at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:344)
at org.apache.tools.ant.Task.maybeConfigure(Task.java:202)
at org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:196)
at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:163)
at org.apache.tools.ant.Task.perform(Task.java:347)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
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.taskdefs.MacroInstance.execute(MacroInstance.java:398)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
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.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: ant4eclipse:executeJdtProject doesn't support the "workspaceid" attribute.
at org.ant4eclipse.ant.jdt.containerargs.JdtClasspathContainerArgumentDelegate.setDynamicAttribute(JdtClasspathContainerArgumentDelegate.java:70)
at org.ant4eclipse.ant.jdt.AbstractExecuteJdtProjectTask.setDynamicAttribute(AbstractExecuteJdtProjectTask.java:63)
at org.apache.tools.ant.IntrospectionHelper.setAttribute(IntrospectionHelper.java:394)
at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:388)
... 31 more
任何人都可以請幫我嗎?
你能告訴我什麼是正確的方法來在這裏進行。 – NareshKumar 2011-06-15 11:39:27
我已經添加了一些建議 – sudocode 2011-06-15 14:24:15