2012-11-03 20 views
1

Im화물을 사용하여 tomcat 서버에 war 파일을 배포합니다. 내가 관리자에 액세스하는 사용자/암호 creds를 제공 할 수있는 방법, 즉컨테이너 재시작시 Tomcat-users.xml이 다시 작성됩니다. 어떻게 자격 증명을 제공합니까?

mvn cargo:run 

컨테이너를 시작할 때 나는 conf의/바람둥이 - users.xml 파일을 다시 작성하지만 같은 매니저에 로그인 할 수없는거야?

환호!

편집 :화물 구성은

<plugins> 
    <!-- Start's the plugin tag for Cargo! --> 
<plugin> 
<groupId>org.codehaus.cargo</groupId> 
<artifactId>cargo-maven2-plugin</artifactId> 
<configuration> 
    <wait>false</wait> 
    <container> 
    <containerId>tomcat${tomcat.major}x</containerId> 
    <zipUrlInstaller> 
     <url>http://archive.apache.org/dist/tomcat/tomcat-${tomcat.major}/v${tomcat.version}/bin/apache-tomcat-${tomcat.version}.tar.gz</url> 
     <extractDir>${project.build.directory}/extract/</extractDir> 
     <downloadDir>${project.build.directory}/download/</downloadDir> 
    </zipUrlInstaller> 
    <output>${project.build.directory}/tomcat${tomcat.major}x.log</output> 
    <log>${project.build.directory}/cargo.log</log> 
    </container> 
    <configuration> 
    <home>${project.build.directory}/tomcat-${tomcat.version}/container</home> 
    <properties> 
     <cargo.logging>high</cargo.logging> 
     <cargo.servlet.port>9080</cargo.servlet.port> 
     <cargo.tomcat.ajp.port>9008</cargo.tomcat.ajp.port> 
    </properties> 
    </configuration> 
</configuration> 
<executions> 
    <execution> 
    <id>start-container</id> 
    <phase>pre-integration-test</phase> 
    <goals> 
     <goal>start</goal> 
     <goal>deploy</goal> 
    </goals> 
    <configuration> 
     <deployer> 
     <deployables> 
      <deployable> 
      <groupId>${project.groupId}</groupId> 
      <artifactId>mod-war</artifactId> 
      <type>war</type> 
      <pingURL>http://localhost:9080/mod-war</pingURL> 
      <pingTimeout>30000</pingTimeout> 
      <properties> 
       <context>mod-war</context> 
      </properties> 
      </deployable> 
     </deployables> 
     </deployer> 
    </configuration> 
    </execution> 
    <execution> 
    <id>stop-container</id> 
    <phase>post-integration-test</phase> 
    <goals> 
     <goal>stop</goal> 
    </goals> 
    </execution> 
</executions> 

+0

화물 플러그인을 어떻게 구성했는지 자세히 설명해 주시겠습니까? 분명히 문서가 훌륭하지는 않지만화물을 사용하여 Tomcat의 임베디드 인스턴스를 실행하는지 또는 원격으로 Tomcat 인스턴스에 배포하는지 여부는 질문에서 완전히 분명하지 않습니다. –

+0

안녕하세요, 답장을 보내 주셔서 감사합니다.이 플러그인은 maven 프로젝트의 대상 폴더에 신선한 tomcat 7 컨테이너를 배포합니다. 나는 또한 내가 시도 할 [link] (http://docs.codehaus.org/display/CARGO/Custom+File+Configurations)를 발견했다. – MikeW

답변

0

그것을 발견. 당신은

 <files> 
     <copy> 
      <file>tomcat-users.xml</file> 
      <tofile>conf/tomcat-users.xml</tofile> 
      <configfile>true</configfile> 
      <overwrite>true</overwrite> 
     </copy> 
     </files> 

그래서 당신은 당신의 자신의 conf/*. 지정 XML 또는 다른 어떤 그것은 용기가 시작되기 전에 복사 할 수 있습니다 (위의 의견에화물 문서에 링크) 다음 XML을 통해 사용자 정의 구성을 제공 할 수 있습니다. 지금 관리자에게 로그인 할 수 있습니다.

건배

관련 문제