2014-08-28 4 views
0

내 응용 프로그램이 URL의 로컬 호스트 (예 : http://localhost:8080/WebIntegrationApp)에서 실행되고 있습니다. http://localhost:8080/WebIntegrationApp url을 http://WebIntegrationApp으로 바꾸는 방법은 pom.xml 파일입니다. URL이 http://WebIntegrationApp 인이 응용 프로그램을 실행하고 싶습니다.로컬 호스트를 pom 파일의 의미 전체 URL 이름으로 바꾸는 방법

사용되는 OS는 로컬 호스트에 대한 Tomcat을 실행하는 데 사용 플러그인이 여기에 Windows7의이고 :

<plugin> 
    <groupId>org.apache.tomcat.maven</groupId> 
    <artifactId>tomcat7-maven-plugin</artifactId> 
    <version>2.2</version> 
    <configuration> 
     <url>http://localhost:8080/manager/text</url> 
     <server>localhost</server> 
     <path>/WebIntegrationApp</path> 
     <username>admin</username> 
     <password>s3cret</password> 

    </configuration> 
    <executions> 
     <execution> 
      <id>tomcat-run</id> 
      <goals> 
       <goal>run-war-only</goal> 
      </goals> 
      <phase>pre-integration-test</phase> 
      <configuration> 
       <fork>true</fork> 
      </configuration> 
     </execution> 

     <execution> 
      <id>tomcat-shutdown</id> 
      <goals> 
       <goal>shutdown</goal> 
      </goals> 
      <phase>post-integration-test</phase> 
     </execution> 
    </executions> 
</plugin> 

답변

0

예. 모든 텍스트 편집기를 사용하여 pom.xml을 편집 할 수 있습니다.

0

로컬 컴퓨터에서 응용 프로그램을 실행하려면 호스트 파일을 편집해야합니다. 윈도우 \ system32를 \ 드라이버 \ 등 \ 리눅스에 :/etc/hosts 파일

+0

감사합니다. 나는 이것이 좋은 생각이 아닌 것 같아요.이 파일을 다른 사용자가 사용해야한다면, 각각이 호스트 파일을 편집해야합니다. 그래서 나는 일반 솔루션을 찾고있다. 하나의 변경은 다른 사람들을 위해 일한다. –

+0

그런 다음 DNS 서버 설정을 구성해야합니다. –

0

이 받는다는와는 아무 상관의 maven-tomcat-plugin는 책임 그리고 윈도우 시스템 호스트 위치에

당신의 pom.xml 수정 구성된 웹 응용 프로그램을 실행 중입니다.

그것은 포트에 첨부 제공 서버 (로컬 호스트)를 사용하고 웹 애플리케이션 콘텍스트 이름 follwed (기본 8080이다); 너의 것은 WebIntegrationApp이다. 당신은 당신이 http://WebIntegrationApp로 리디렉션됩니다 귀하의 브라우저에서 http://localhost:8080/WebIntegrationApp를 쳤을 때 당신이 달성하려고하는 무엇

은 그래서 일부 라우팅 규칙을 구성하여 같은 Apache Httpd 같은 프런트 엔드 서버를 사용하여 수행 할 수 있습니다. 뒤에서는 뒤집기 메커니즘이 있으므로 맞을 때 http://WebIntegrationApp; 백그라운드에서 요청은 http://localhost:8080/WebIntegrationApp으로 전송됩니다.

Apache Httpd 서버에 익숙하지 않은 경우 약간의 구성이 필요합니다. 여기에 줄을 단축해야하는 VirtualHost 설정이 있습니다 :

<VirtualHost *:80> 
    ServerName  Enter your server DNS name here 
    ProxyRequests Off 
    ProxyPreserveHost On 
    ProxyPass "/" http://localhost:8080/ 
    ProxyPassReverse "/" http://localhost:8080/ 
</VirtualHost>