2014-06-09 4 views
2

배포시 WEB-INF/jboss-web.xml에 지정된 루트 컨텍스트를 무시할 수 있습니까?배포시 wildfly 8의 웹 응용 프로그램 루트 컨텍스트 지정

나는이 보스 - web.xml에

<?xml version="1.0" encoding="UTF-8"?> 
<jboss-web> 
    <context-root>my-context</context-root> 
</jboss-web> 

을하고 난에, 예를 들어 서로 다른 루트 컨텍스트를 사용하여 응용 프로그램을 배포 할 수 있도록하려면/내 환경의 일부에 대해서는 다른 컨텍스트이지만 다른 환경에서는/내 컨텍스트를 유지해야합니다. 여기에 설명 된대로

+0

심볼릭 링크/ROOT.war에 전쟁 파일의 이름을 변경하는 제이 보스 - web.xml 파일에서 컨텍스트를 무시하고 루트 컨텍스트 (/)에 deployes. Wildfly는 Glassfish가 루트가 아닌 다른 컨텍스트를 설정할 수있는 --contextroot와 같은 simliar 기능을 가지고 있습니까? – ivar

답변

0

이 일을 위해, 당신은 받는다는 프로파일 (예 : "내 컨텍스트"와 "다른 컨텍스트")와 받는다는 자원 필터링을 결합 할 수 있습니다 : Maven resource filters

을 그것은 확실히 모든 때까지 약간의 시간이 소요됩니다 예상대로 작동합니다. 당신이 EAR 파일이있는 경우

-1

당신은 나 제이보스 CLI를 사용합니다 (CI 작업의 일환으로) 당신의 application.xml을 WildFly Maven Plugin을 통해 당신은이 작업을 수행 할 수

<module> 
    <web> 
    <web-uri>webapp.war</web-uri> 
    <context-root>/my-context</context-root> 
    </web> 
</module> 
1

에 그것을 정의 할 필요가있다.

받는다는 변형은 다음 명령과 같은 것이다 :

org.wildfly.plugins:wildfly-maven-plugin:deploy-only 
    -Dwildfly.deployment.filename=app.war 
    -Dwildfly.deployment.runtime.name=appcontext.war 

이 앱은 /appcontext에 따라 배포됩니다.

주, 그렇지 않으면이 값은 항상 이길 것이다 의 jboss-web.xml을에서 컨텍스트 루트을 제거해야합니다.

CLI를 변종 (documentation)처럼 보일 수 :

[[email protected] wildfly-8.2.0.Final]$ bin/jboss-cli.sh 
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands. 
[disconnected /] connect 
[[email protected]:9990 /] deploy /path/to/app.war --runtime-name=appcontext.war 
관련 문제