[英]ant4eclipse classpath problem
我的項目和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"/
.classpath
有一個容器條目。 這是一種簡寫,表示“包括所有屬於此容器的罐子”。 組成一個容器的jar的定義存儲在工作區的.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文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.