2013-05-16 2 views
0

간단한 qustion을 묻습니다. 나는 개미에 익숙하지 않고 jar 파일을 만들려고 노력 중이다. 나는 패키지 구조 내부의 파일특정 디렉토리의 병에 파일 패키징

jaxb.index

COM/MYCOM/mg의 난에이 파일을 패키징하는 것을 시도하고있다

/어댑터 내 항아리를 사용하여

<target name="dist" description="Create distributable jar file"> 
    <jar destfile="${common.lib.dir}/${dist.file}"> 
     <fileset dir="${build.classes.dir}"/> 
     <zipfileset 
      file="${sms.syn.dir}/jaxb.index"> 
     </zipfileset> 
    </jar> 
</target> 

같은 패키지 com/mycom/mg/adapter에 jaxb.index 파일을 넣고 싶습니다.하지만 위의 코드를 사용하면 ant가 jar 파일의 루트에 추가됩니다. 누구든지 나를 도울 수 있습니까? 하나

<zipfileset 
      file="${sms.syn.dir}/jaxb.index" fullpath="com/mycom/mg/adapter"> 
</zipfileset> 

나던 도움말을 사용

편집 .

답변

2

당신이 속성 prefix 대신 fullpath 사용해야 보인다 : 나는 fullpath도 작동해야하지만 당신이 정말로 전체 경로를 지정해야한다고 생각

<zipfileset 
      file="${sms.syn.dir}/jaxb.index" prefix="com/mycom/mg/adapter"> 
</zipfileset> 

를, 파일 이름, 즉 경로 : fullpath="com/mycom/mg/adapter/jaxb.index"

1

이런 식으로 사용해야 할 수도 있습니다.

<zipfileset dir="${sms.syn.dir}" includes="jaxb.index" fullpath="com/mycom/mg/adapter"/> 
+0

감사합니다. AlexR 제안대로 fullpath 속성에 파일 이름 jaxb.index를 추가해야했습니다. – CuriousCoder

관련 문제