2017-12-19 40 views
0

저지와 함께 아파치 freemarker에서 작업하고 있습니다. 템플릿이없는 war 파일을 만들 때 템플리트 폴더에 .ftl 템플릿을 저장하고 있습니다. 개미를 사용하여 war 파일에서 템플릿을 만들고 복사하는 방법

<target name="war" depends="clean,compile,copy-resources"> 
    <war destfile="${dist}/sample.war" webxml="WEB-INF/web.xml"> 
     <fileset dir="WebContent"/> 
     <webinf dir="WEB-INF" includes="**/log4j.properties"></webinf> 
     <lib dir="${lib}"/> 
     <classes dir="${build}"/> 
     <templates dir="${templates}"/> 
    </war>  
</target> 

이 코드는

war doesn't support the nested "templates" element. 

클래스를 말하는 및 lib 폴더가 추가하지만 템플릿 폴더 전쟁 파일에 만들어지지 않습니다 빌드.

감사합니다, 프라 빈 R.

답변

0

코드 아래의 템플릿 폴더의 사용을 작성하고 복사하려면 : 당신이 여기에, 전쟁에 .ftl 파일을 포함하는 zipfileset를 사용해야하지만 처럼 보이게하는 방법입니다 이 폴더를 전쟁 파일이 폴더를 사용하여

<webinf dir="WEB-INF" includes="**/log4j.properties,templates/"></webinf> 

이 내 문제를 해결했습니다.

0

war Task에서 살펴보고 해당 페이지의 예를 참조하십시오.

<copy todir="${templates}"> 

추가하려면

<zipfileset dir="${home.dir}/PATH_TO_FTL" includes="**/*.ftl" />