1

我正在使用 Ant4Eclipse 构建一个 ear 包。

你能告诉我如何继续吗?

<ear destfile="${deploy}/pto-web-ear.ear">
  <ant4eclipse:jdtProjectFileSet workspaceDirectory="/data/temp/ANT/PSFBUILD"
                                 projectName="pto-web-ear" />
</ear>

我在上面使用。

但这导致我出错:

/data/temp/ANT/PSFBUILD/pto-web-ear/ant4eclipsebuild.xml:59: org.ant4eclipse.lib.core.exception.Ant4EclipseException:
A precondition has been violated: hasRole(projectRoleClass) on project 'pto-web-ear'
has to be true for role 'interface org.ant4eclipse.lib.jdt.model.project.JavaProjectRole'!
    at org.ant4eclipse.lib.core.Assure.assertTrue(Assure.java:264)
    at org.ant4eclipse.lib.platform.internal.model.resource.EclipseProjectImpl.getRole(EclipseProjectImpl.java:424)
    at org.ant4eclipse.ant.jdt.JdtProjectFileSet.doComputeFileSet(JdtProjectFileSet.java:193)
    at org.ant4eclipse.ant.platform.core.task.AbstractAnt4EclipseFileSet.computeFileSet(AbstractAnt4EclipseFileSet.java:276)
    at org.ant4eclipse.ant.platform.core.task.AbstractAnt4EclipseFileSet.iterator(AbstractAnt4EclipseFileSet.java:243)
    at org.apache.tools.ant.taskdefs.Zip.grabNonFileSetResources(Zip.java:1585)
    at org.apache.tools.ant.taskdefs.Zip.getNonFileSetResourcesToAdd(Zip.java:1451)
    at org.apache.tools.ant.taskdefs.Zip.getResourcesToAdd(Zip.java:1215)
    at org.apache.tools.ant.taskdefs.Jar.getResourcesToAdd(Jar.java:868)
    at org.apache.tools.ant.taskdefs.Zip.executeMain(Zip.java:615)
    at org.apache.tools.ant.taskdefs.Zip.execute(Zip.java:568)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
    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)

任何人都可以请在这里帮助我吗?

4

0 回答 0