我的项目和ant4eclipse有问题。如果我运行build.xml,我会得到这样的消息:
Exception in thread "main" : org.ant4eclipse.lib.core.exception.Ant4EclipseException: Exception
whilst resolving the classpath entry '[EclipseClasspathEntry: path:
org.eclipse.jst.j2ee.internal.module.container entryKind: 0 outputLocation: null exported: false]' of project 'MyProject': '
No 'jdtClassPathLibrary' defined for library entry
'org.eclipse.jst.j2ee.internal.module.container'.
To resolve this problem, please define a 'jdtClassPathLibrary'
element inside your ant build file:
ant4eclipse:jdtClassPathLibrary name="org.eclipse.jst.j2ee.internal.module.container"
fileset dir="..."/
/ant4eclipse:jdtClassPathLibrary 但是我在哪里可以找到这些文件呢?.classpath文件只有以下条目:
classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/发布于 2011-07-27 17:36:27
您的.classpath中包含的是一个容器条目。这是一种速记,意思是“包含这个容器中的所有jars”。jars组成容器的定义存储在工作区的.metadata目录中名为variablesAndContainers.dat的文件中(这些定义是工作区范围内的,而不是特定项目的范围)。
据我所知,ant4eclipse可以读取.classpath files,但不能读取variablesAndContainers.dat文件(几年前我上次使用ant4eclipse时确实如此)。这意味着,尽管它可以找到您在org.eclipse.jst.j2ee.internal.module.container容器中有一个类路径条目,但它无法找到该容器的定义是什么。
因此,无论何时使用容器,都必须以ant4eclipse:jdtClassPathLibrary元素的形式向ant4eclipse提供容器的定义,这与错误消息所说的完全相同:
<ant4eclipse:jdtClassPathLibrary name="org.eclipse.jst.j2ee.internal.module.container">
<fileset dir="..."/>
</ant4eclipse:jdtClassPathLibrary>fileset标记应该定义组成容器的jar文件。
https://stackoverflow.com/questions/6841771
复制相似问题