0
我有一個在Netbeans中啓動的Tomcat 8 web項目。 在Netbeans中,我設置了一些全局庫,然後添加到項目中。在Netbeans中構建項目完美地工作。即使jar在WEB-INF/lib中也沒有找到軟件包
問題是,當我嘗試在使用Ant的Unix平臺上構建時。 我用的Netbeans自動生成的build.xml文件,唯一的區別是,我現在必須指定這些「全局」庫,我這樣做,因爲這樣:
ant -Dlibs.spring-framework-4.0.6.classpath="../libs/spring-framework-4.0.6.RELEASE" clean dist
然而這會導致這些類型錯誤:
error: package org.springframework.beans.factory does not exist
如果我去看看在網絡/ WEB-INF/lib目錄中生成文件夾內,罐子是存在的,如果我看上去裏面我找到org.springframework.beans.factory類。
如果我運行在調試模式下的螞蟻它明確規定,被複制在庫:
[copy] Copying /libs/spring-framework-4.0.6.RELEASE/spring-beans-4.0.6.RELEASE.jar to /App/build/web/WEB-INF/lib/spring-beans-4.0.6.RELEASE.jar
據我瞭解,在WEB-INF/lib目錄默認是打開的類路徑。這是不是發生了什麼,我需要專門告訴它將此目錄添加到類路徑?