How to use .project to build ear with ANT4Eclipse?
I am using ant4eclipse
to build 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 thing.
But it leads me to the following 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.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 any-one please please help me here.
Thanks User
I was also facing similar problem. Right Click convert the project into Plug-in Tool has solved the issue for me.
精彩评论