开发者

How to resolve JavaProjectRole when building an ear using Ant4Eclipse ?

I am using Ant4Eclipse to build an ear package.

Can you please let me know how to proceed with it?

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

I am using above.

But it leads me to an error:

/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开发者_JAVA百科.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)

Can anyone please please help me here?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜