2016-09-07 6 views
0

여기에 나와있는 지침에 따라 glassfish 컨테이너에 사용자 정의 속성을 전달하려고합니다. https://codehaus-cargo.github.io/cargo/Passing+system+properties.html 나는 나의 치어에서 설정이 있습니다유형이 "원격"인 경우 Glassfish 컨테이너의화물 속성에 액세스 할 수 없습니다.

<plugin>  
        <groupId>org.codehaus.cargo</groupId> 
        <artifactId>cargo-maven2-plugin</artifactId> 
        <version>1.5.0</version> 
        <configuration> 

         <container> 
          <containerId>${glassfishId}</containerId> 
          <type>remote</type> 
          <systemProperties> 
           <foofy>barr</foofy> 
          </systemProperties> 
         </container>   
         <configuration> 
          <type>runtime</type> 
          <properties> 
           <cargo.hostname>${target}</cargo.hostname> 
           <cargo.remote.name>wiley</cargo.remote.name> 
           <cargo.remote.username>${username}</cargo.remote.username> 
           <cargo.remote.password>${password}</cargo.remote.password> 
           <cargo.glassfish.admin.port>4848</cargo.glassfish.admin.port> 
          </properties> 
         </configuration> 
         <deployables> 
          <deployable> 
           <artifactId>wiley</artifactId> 
           <type>war</type> 
           <properties> 
           <context>/wiley</context> 
           </properties> 
          </deployable> 
         </deployables>    
        </configuration> 
        <dependencies> 
         <dependency> 
          <groupId>org.glassfish.deployment</groupId> 
          <artifactId>deployment-client</artifactId> 
          <version>3.2-b06</version> 
         </dependency> 
        </dependencies> 
       </plugin>  

하지만 사용하여 자바 코드에서 foofy에 액세스하려고 할 때 하나 System.getenv ("foofy") 또는은 System.getProperty ("foofy") 둘 다 널을 리턴합니다. 내가 봤 거든, 모든 작업 예제는 Tomcat과 같다. type = "remote"일 때 Glassfish에서 작동하지 않습니까?

답변

0

화물 소스 코드를 보면 시스템 속성과 구성 파일처럼 보입니다.이 두 기능은 원격 모드에서 지원되지 않습니다. 특정 구성 파일을 대체하기 위해 전쟁을 수정하기 위해 카고 플러그인 이전에 앤트 작업을 종료했습니다.