2015-02-02 2 views
0

maven과 함께 원격 서버에 응용 프로그램을 배포하여 지속적인 통합 시스템을 구축하고 싶습니다. :)원격 서버에 maven-tomcat 플러그인 배포

stackoverflow에서 많은 문제를 확인했지만 제대로 작동하지 않습니다. 먼저 오류를 보여주고 구성을 구성합니다. 여기 업로드에 대한 메시지를 SI, 그것은 올바른 것 같다 : Uploaded: http://SERVEUR_IP/manager/text/deploy?path=%2FGiveMeAShow (49631 KB at 51.5 KB/sec)

오류 :

[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project GiveMeAShow: Tomcat return http status error: 401, Reason Phrase: Unauthorized: 
[ERROR] <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
[ERROR] <html> 
[ERROR] <head> 
[ERROR] <title>401 Unauthorized</title> 
[ERROR] <style type="text/css"> 
[ERROR] <!-- 
[ERROR] BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;font-size:12px;} 
[ERROR] H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} 
[ERROR] PRE, TT {border: 1px dotted #525D76} 
[ERROR] A {color : black;}A.name {color : black;} 
[ERROR] --> 
[ERROR] </style> 
[ERROR] </head> 
[ERROR] <body> 
[ERROR] <h1>401 Unauthorized</h1> 
[ERROR] <p> 
[ERROR] You are not authorized to view this page. If you have not changed 
[ERROR] any configuration files, please examine the file 
[ERROR] <tt>conf/tomcat-users.xml</tt> in your installation. That 
[ERROR] file must contain the credentials to let you use this webapp. 
[ERROR] </p> 
[ERROR] <p> 
[ERROR] For example, to add the <tt>manager-gui</tt> role to a user named 
[ERROR] <tt>tomcat</tt> with a password of <tt>s3cret</tt>, add the following to the 
[ERROR] config file listed above. 
[ERROR] </p> 
[ERROR] <pre> 
[ERROR] &lt;role rolename="manager-gui"/&gt; 
[ERROR] &lt;user username="tomcat" password="s3cret" roles="manager-gui"/&gt; 
[ERROR] </pre> 
[ERROR] <p> 
[ERROR] Note that for Tomcat 7 onwards, the roles required to use the manager 
[ERROR] application were changed from the single <tt>manager</tt> role to the 
[ERROR] following four roles. You will need to assign the role(s) required for 
[ERROR] the functionality you wish to access. 
[ERROR] </p> 
[ERROR] <ul> 
[ERROR] <li><tt>manager-gui</tt> - allows access to the HTML GUI and the status 
[ERROR] pages</li> 
[ERROR] <li><tt>manager-script</tt> - allows access to the text interface and the 
[ERROR] status pages</li> 
[ERROR] <li><tt>manager-jmx</tt> - allows access to the JMX proxy and the status 
[ERROR] pages</li> 
[ERROR] <li><tt>manager-status</tt> - allows access to the status pages only</li> 
[ERROR] </ul> 
[ERROR] <p> 
[ERROR] The HTML interface is protected against CSRF but the text and JMX interfaces 
[ERROR] are not. To maintain the CSRF protection: 
[ERROR] </p> 
[ERROR] <ul> 
[ERROR] <li>Users with the <tt>manager-gui</tt> role should not be granted either 
[ERROR] the <tt>manager-script</tt> or <tt>manager-jmx</tt> roles.</li> 
[ERROR] <li>If the text or jmx interfaces are accessed through a browser (e.g. for 
[ERROR] testing since these interfaces are intended for tools not humans) then 
[ERROR] the browser must be closed afterwards to terminate the session.</li> 
[ERROR] </ul> 
[ERROR] <p> 
[ERROR] For more information - please see the 
[ERROR] <a href="/docs/manager-howto.html">Manager App HOW-TO</a>. 
[ERROR] </p> 
[ERROR] </body> 
[ERROR] 
[ERROR] </html> 
[ERROR] -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 

그것은, 그것은 권한 문제가 꽤 분명 보인다. 나는 모든 역할을 부여하지 않아야 알고

<?xml version='1.0' encoding='utf-8'?> 
<tomcat-users> 
     <role rolename="manager-gui"/> 
     <role rolename="admin-gui"/> 
     <role rolename="manager-script"/> 
     <role rolename="admin-script"/> 
     <user username="admin" password="password" roles="manager-gui,manager-script,admin-gui,admin-script" /> 
</tomcat-users> 

을하지만, 헤이 그래서 나는 :)을 시도하고 작동하지 않습니다의 내 원격 tomcat7 바람둥이-users.xml에서 파일을 살펴보기로하자.

브라우저에서 "admin"및 "password"로 HTTP를 통해 앱 관리자/관리 페이지에 로그인 할 수 있습니다. 나는 이것이 괜찮다고 생각한다. 나는 전쟁 파일을 업로드 할 수 없습니다 시도하기 시작했을 때

<plugin> 
    <groupId>org.apache.tomcat.maven</groupId> 
    <artifactId>tomcat7-maven-plugin</artifactId> 
    <version>2.2</version> 
    <configuration> 
     <usernamee>admin</usernamee> 
     <password>password</password> 
     <url>http:SERVEUR_IP/manager/text</url> 
     <server>TomcatServer</server> 
     <path>/GiveMeAShow</path> 
    </configuration> 
</plugin> 

:

여기 받는다는 - 바람둥이 - 플러그인 내 구성입니다. 이것을 추가하면 그렇게 할 수있었습니다. 그러나 인증 문제는 나중에 발생합니다.

는 또한 ~/.m2/settings.xml 내 원격 서버에 Settings.XML의 파일을 넣어했습니다

<?xml version='1.0' encoding='utf-8'?> 
<servers> 
     <server> 
       <id>TomcatServer</id> 
       <username>admin</username> 
       <password>password</password> 
     </server> 
</servers> 

~/.m2 폴더는 하나 개의 하위 폴더 및 내가 만든이 파일이 포함되어 있습니다.

루트 사용자를 사용하여이 모든 작업을 수행하고 있습니다.

지금 무엇을 시도해야할지 모르겠다 고 고맙습니다.

편집은 내가 @fatteddy 좋아했다

는 말했다 : 을 - 배포 전용 사용자를 만들었습니다. 단지 역할과 함께 "관리 스크립트" 는 - 나는에 TRAVIS-CI에서 테스트 한로 배포 전용 사용자가 작업의 대부분을 한 creting 생각 <usernamee>

</username>에 변경 pom.xml 파일 내 오류를 수정 오류가없는 <username> 태그의 env 변수가있는 동일한 시간.

답변

2

실제로 이것은 인증 문제입니다. manager-script (이 경우에만 해당) 역할이 할당 된 개별 배포 사용자를 (보안상의 이유로 분명히) 정의하려고합니다. 바람둥이를 다시 시작하는 것을 잊지 마십시오.

이 바람둥이 관리자 URL의 경로 세그먼트를 변경 도움이되지 않는 경우 (조합 manager/, manager, manager/text, manager/text/ -> 지금까지의 내가있다/또는 수정 된 후행 슬래시 된 문제가 기억할 수있는 최신 Tomcat 버전에서)

+0

안녕하세요, 저는 확실합니다. "관리자 스크립트"역할 만있는 배포 관련 사용자를 만듭니다. 그런 다음 작동하지 않으면 대상 URL을 tomcat-maven 플러그인에서 변경하려고 시도합니다. 나는 당신이 인용 한 "매니저/텍스트"와 "매니저/텍스트"의 차이점을 이해하지 못한다 : /. 물론, 나는 tomcat을 다시 시작해야합니다 : :). 도와 주셔서 감사합니다. – ogdabou

+0

deploymet 특정 사용자에게 예 - 그리고 미안합니다 -> 빠진 슬래시 (고정)를 추가하는 것을 잊어 버렸습니다. – fateddy

+0

Ok, 고맙습니다. : – ogdabou

0

내가 잊어 버린 가장 간단한 것은 - 설정이 변경된 후 Tomcat을 다시 시작하는 것입니다.이 문구 - "바람둥이를 다시 시작하는 것을 잊지 마세요"는 많은 도움이되었습니다! :)

관련 문제