2014-09-24 2 views
0

Netbeans에서 시작한 Tomcat 8 웹 프로젝트가 있습니다. Netbeans에서는 일부 글로벌 라이브러리를 설치 한 다음 프로젝트에 추가했습니다. Netbeans에서 프로젝트를 완벽하게 작동합니다.jar 파일이 WEB-INF/lib에 있어도 패키지를 찾을 수 없습니다.

문제는 Ant를 사용하여 Unix 플랫폼에서 빌드하려고 할 때입니다. 내가 자동으로 넷빈즈에 의해 생성 된 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 클래스를 찾을 수 있습니까 . 내가 디버그 모드에서 개미를 실행하면

는 명확하게 libs와 이상 복사하는 것을 말한다 :

[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 디렉토리는 기본적으로 클래스 패스에 있습니다. 이것은 어떤 일이 아니며 클래스 경로에이 디렉토리를 추가하도록 구체적으로 알려야합니까?

답변

0

해결책을 직접 찾았습니다. 각 항아리를 구체적으로 참조해야한다는 것을 알게되었습니다. 디렉토리를 참조하기에 충분하지 않습니다.

그래서이 :

ant -Dlibs.spring-framework-4.0.6.classpath="../libs/spring-framework-4.0.6.RELEASE/spring-aop-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-aspects-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-beans-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-context-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-context-support-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-core-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-expression-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-framework-bom-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-instrument-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-instrument-tomcat-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-jdbc-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-jms-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-messaging-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-orm-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-oxm-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-test-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-tx-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-web-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-webmvc-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-webmvc-portlet-4.0.6.RELEASE.jar:../libs/spring-framework-4.0.6.RELEASE/spring-websocket-4.0.6.RELEASE.jar" clean dist 
:

ant -Dlibs.spring-framework-4.0.6.classpath="../libs/spring-framework-4.0.6.RELEASE" clean dist 

이 있었을해야

관련 문제