2010-12-01 5 views
0

내 webapp에는 다음과 같이 db 암호를 지정하는 최대 절전 모드 구성 파일이 있습니다. 개미 파일에 db 암호를 지정하십시오.

 
<property name="hibernate.connection.password">p1ssw2rd</property> 
또한 개미 빌드 파일이 있습니다. 빌드시 db 암호를 지정한 다음에 전달할 수 있습니까? 최대 절전 모드?

 

    <target name="init-development"> 

     <property name="databasePassword" value="xxxx"/> 
    </target> 

답변

2

이 같은 암호 레이블 설정을 최대 절전 모드 템플릿을 만들 수 있습니다

<property name="hibernate.connection.password">@@[email protected]@</property> 

과 개미는 빌드를 시작할 때, 실제 DB를 암호로 대체 암호 레이블이 지정된 적용, 실제 최대 절전 모드 설정을 통해 템플릿 설정을 복사 build.xml에 있습니다. 그것은 그런 식입니다 : D 그것은

작동 : 내가하고 ReplaceString

의 섹션 <replacetokens> <token key="@@[email protected]@" value="${databasePassword}"/> </replacetokens>

을 변경

<copy file="${src.dir}/hibernate-config.xml.tpl" 
     tofile="${src.dir}/hibernate-config.xml"> 
    <filterchain> 
      <replacetokens> 
       <token key="@@[email protected]@" 
         value="${databasePassword}"/> 
      </replacetokens> 
    </filterchain> 
</copy> 
관련 문제