我的问题
我使用新的1.7.5 GAE / J SDK将我的应用程序从1.x版移植到GAE / J的DataNucleus插件的2.0版本,但是我无法使用参数-enhancerVersion
和v2
成功了。 (没有这些参数的默认目标是DataNucleus GAE / J插件的版本1,我不想要它吗?)
有谁知道如何成功指定这些参数?
我的软件环境
背景信息和构建失败日志输出
上的GAE / J文档
表示:
In build.xml
...
2. The datanucleusenhance target has changed. Update this section:
<target name="datanucleusenhance" depends="compile"
description="Performs enhancement on compiled data classes.">
<enhance_war war="war" />
</target>
to:
<target name="datanucleusenhance" depends="compile"
description="Performs enhancement on compiled data classes.">
<enhance_war war="war">
<args>
<arg value="-enhancerVersion"/>
<arg value="v2"/>
</args>
</enhance_war>
</target>
我的NetBeans build.xml
中的代码略有不同:
<!-- ******************************************************************* -->
<!-- ** -->
<!-- ** This block extends the original "-post-compile" target in -->
<!-- ** "nbproject/build-impl.xml" by adding "depends" and "description" -->
<!-- ** attributes and implementing them. -->
<!-- ** -->
<target
name="-post-compile"
depends="datanucleusenhancer"
description="Called after javac compilation (DataNucleus enhancement)"
/>
...
<target
name="datanucleusenhancer"
description="Performs the DataNucleus post-compilation enhancement"
>
<taskdef
name="datanucleusenhancertask"
classpathref="datanucleus.enhancer.classpath"
classname="org.datanucleus.enhancer.tools.EnhancerTask"
/>
<datanucleusenhancertask
dir="${build.classes.dir}"
classpathref="datanucleus.enhancer.classpath"
api="JDO"
failonerror="true"
verbose="true"
filesuffixes="class"
>
<fileset dir="${build.classes.dir}" casesensitive="false">
<filename name="**/persistence/**"/>
</fileset>
<jvmarg line="-Dlog4j.configuration=file:nbproject/log4j.properties"/>
<args> <!-- Added -->
<arg value="-enhancerVersion"/> <!-- code -->
<arg value="v2"/> <!-- to set -->
</args> <!-- args -->
</datanucleusenhancertask>
</target>
构建过程因输出失败:
...
datanucleusenhancer:
Enhancer api: JDO
Enhancer verbose: true
C:\...\build.xml:154: datanucleusenhancertask doesn't support the nested "args" element.
at org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:362)
at org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:201)
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.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
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.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:283)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:541)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
Caused by: The <datanucleusenhancertask> type doesn't support the nested "args" element.
at org.apache.tools.ant.IntrospectionHelper.throwNotSupported(IntrospectionHelper.java:503)
at org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:352)
... 12 more
BUILD FAILED (total time: 44 seconds)