-->

[JBoss & Wildfly] System property 세팅 및 사용

 

standalone.xml 파일을 열어서 다음과 같이 수정해준다.

<?xml version='1.0' encoding='UTF-8'?>

<server xmlns="urn:jboss:domain:4.2">
    <extensions>       
        ...
    </extensions>
    
    <!-- 시스템 프로퍼티 추가-->
    <system-properties>        
        <property name="server.type" value="dev"/>
    </system-properties>
    
    ...
</server>

 

WAS를 기동시 키고 java단에서 System.getProperty("server.type") 함수를 사용하면 "dev" 값이 나온다.

 

https://kb.novaordis.com/index.php/WildFly_System_Properties#Standard_System_Properties

 

WildFly System Properties - NovaOrdis Knowledge Base

Internal Overview System properties can be declared in the server's configuration files and are propagated to the server JVMs and implicitly to applications. For more details on how system property can be declared, see Declaration in Configuration Files be

kb.novaordis.com

 

+ Recent posts