2013-06-25 7 views
3

Я использую плагин apache tomcat maven для развертывания военного файла на удаленном сервере tomcat. Вот моя конфигурация плагин в pom.xml,Tomcat7 maven plugin deploy failonerror

<plugin> 
    <groupId>org.apache.tomcat.maven</groupId> 
    <artifactId>tomcat7-maven-plugin</artifactId> 
    <version>2.1</version> 
    <configuration> 
     <url>http://localhost:8080/manager/text</url> 
     <server>INT</server> 
    </configuration> 
</plugin> 

При запуске Maven сборки и развертывания не удается из-за какой-то причине, по-прежнему Maven сборки говорит BUILD SUCCESS.

[INFO] tomcatManager status code:401, ReasonPhrase:Unauthorized 
[INFO] <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/h 
tml4/strict.dtd"> 
[INFO] <html> 
[INFO] <head> 
[INFO] <title>401 Unauthorized</title> 
[INFO] <style type="text/css"> 
[INFO]  <!-- 
[INFO]  BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-colo 
r:white;font-size:12px;} 
[INFO]  H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color: 
#525D76;font-size:22px;} 
[INFO]  PRE, TT {border: 1px dotted #525D76} 
[INFO]  A {color : black;}A.name {color : black;} 
[INFO]  --> 
[INFO] </style> 
[INFO] </head> 
[INFO] <body> 
[INFO] <h1>401 Unauthorized</h1> 
[INFO] <p> 
[INFO]  You are not authorized to view this page. If you have not changed 
[INFO]  any configuration files, please examine the file 
[INFO]  <tt>conf/tomcat-users.xml</tt> in your installation. That 
[INFO]  file must contain the credentials to let you use this webapp. 
[INFO] </p> 
[INFO] <p> 
[INFO]  For example, to add the <tt>manager-gui</tt> role to a user named 
[INFO]  <tt>tomcat</tt> with a password of <tt>s3cret</tt>, add the following 
to the 
[INFO]  config file listed above. 
[INFO] </p> 
[INFO] <pre> 
[INFO] &lt;role rolename="manager-gui"/&gt; 
[INFO] &lt;user username="tomcat" password="s3cret" roles="manager-gui"/&gt; 
[INFO] </pre> 
[INFO] <p> 
[INFO]  Note that for Tomcat 7 onwards, the roles required to use the manager 

[INFO]  application were changed from the single <tt>manager</tt> role to the 

[INFO]  following four roles. You will need to assign the role(s) required fo 
r 
[INFO]  the functionality you wish to access. 
[INFO] </p> 
[INFO]  <ul> 
[INFO]  <li><tt>manager-gui</tt> - allows access to the HTML GUI and the st 
atus 
[INFO]   pages</li> 
[INFO]  <li><tt>manager-script</tt> - allows access to the text interface a 
nd the 
[INFO]   status pages</li> 
[INFO]  <li><tt>manager-jmx</tt> - allows access to the JMX proxy and the s 
tatus 
[INFO]   pages</li> 
[INFO]  <li><tt>manager-status</tt> - allows access to the status pages onl 
y</li> 
[INFO]  </ul> 
[INFO] <p> 
[INFO]  The HTML interface is protected against CSRF but the text and JMX int 
erfaces 
[INFO]  are not. To maintain the CSRF protection: 
[INFO] </p> 
[INFO] <ul> 
[INFO]  <li>Users with the <tt>manager-gui</tt> role should not be granted ei 
ther 
[INFO]   the <tt>manager-script</tt> or <tt>manager-jmx</tt> roles.</li> 
[INFO]  <li>If the text or jmx interfaces are accessed through a browser (e.g 
. for 
[INFO]   testing since these interfaces are intended for tools not humans) 
then 
[INFO]   the browser must be closed afterwards to terminate the session.</ 
li> 
[INFO] </ul> 
[INFO] <p> 
[INFO]  For more information - please see the 
[INFO]  <a href="/docs/manager-howto.html">Manager App HOW-TO</a>. 
[INFO] </p> 
[INFO] </body> 
[INFO] </html> 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD SUCCESS 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 2.216s 
[INFO] Finished at: Tue Jun 25 09:59:51 PST 2013 
[INFO] Final Memory: 9M/23M 
[INFO] ------------------------------------------------------------------------ 
D:\Workspace\SVN\webroot> 

Я заметил, что это не тот случай с предыдущим org.codehaus.mojo плагин. Есть ли способ установить FailOnError, чтобы я знал, когда не удастся выполнить развертывание?

ответ

0

Такая же проблема в моей сборке. Это похоже на ошибку.

Этот плагин работает в моем случае с Tomcat7, без каких-либо изменений в конфигурации:

<groupId>org.codehaus.mojo</groupId> 
<artifactId>tomcat-maven-plugin</artifactId> 
<version>1.1</version> 
+0

Это старый. По-видимому, «org.apache» - это текущий. http://mojo.codehaus.org/tomcat-maven-plugin/ – anoopelias

+0

Anoopelias, вы правы, org.apache является текущим, но он не вызывает ошибки BUILD FAILURE при развертывании ошибки, org.codehaus делает. –

0

В версии 2.2 эта ошибка исправлена.

<groupId>org.apache.tomcat.maven</groupId> 
<artifactId>tomcat7-maven-plugin</artifactId> 
<version>2.2</version>