2016-12-02 9 views
1

MavenベースのwarファイルをTomcatにデプロイします。使用 技術:Maven Tomcatにデプロイ

のMaven 3.1.1 のEclipse 4.2 JDK 7 春4.1.1.RELEASED のTomcat 7 Logback 1.0.13

私はMavenのファイルにこのプラグインを持っている:

<!-- For Maven Tomcat Plugin --> 
      <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>TomcatServer</server> 
       <path>/DevicesCloudWebApp</path> 
       <username>admin</username> 
       <password>admin</password> 
       <update>true</update> 
      </configuration> 
      </plugin> 

ただし、コマンドを使用して展開する場合mvn tomcat7:deploy

このエラーがあります:

[DEBUG] Connection 0.0.0.0:62265<->127.0.0.1:8080 closed 
    [INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] >>> tomcat7-maven-plugin:2.2:deploy (default-cli) > package @ DevicesCloudWebApp >>> 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ DevicesCloudWebApp --- 
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] Copying 1 resource 
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ DevicesCloudWebApp --- 
[INFO] Nothing to compile - all classes are up to date 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ DevicesCloudWebApp --- 
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] skip non existing resourceDirectory /Users/nullpointer/Development/J2EE/eclipseWSJ2EE/DevicesCloudWebApp/src/test/resources 
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ DevicesCloudWebApp --- 
[INFO] No sources to compile 
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ DevicesCloudWebApp --- 
[INFO] No tests to run. 
[INFO] 
[INFO] --- maven-war-plugin:2.2:war (default-war) @ DevicesCloudWebApp --- 
[INFO] Packaging webapp 
[INFO] Assembling webapp [DevicesCloudWebApp] in [/Users/nullpointer/Development/J2EE/eclipseWSJ2EE/DevicesCloudWebApp/target/DevicesCloudWebApp] 
[INFO] Processing war project 
[INFO] Copying webapp resources [/Users/nullpointer/Development/J2EE/eclipseWSJ2EE/DevicesCloudWebApp/src/main/webapp] 
[INFO] Webapp assembled in [97 msecs] 
[INFO] Building war: /Users/nullpointer/Development/J2EE/eclipseWSJ2EE/DevicesCloudWebApp/target/DevicesCloudWebApp.war 
[INFO] WEB-INF/web.xml already added, skipping 
[INFO] 
[INFO] <<< tomcat7-maven-plugin:2.2:deploy (default-cli) < package @ DevicesCloudWebApp <<< 
[INFO] 
[INFO] --- tomcat7-maven-plugin:2.2:deploy (default-cli) @ DevicesCloudWebApp --- 
[INFO] Deploying war to http://localhost:8080/DeviceslCloudWebApp 
Uploading: http://localhost:8080/manager/text/deploy?path=%2FDeviceslCloudWebApp 
2170/6062 KB 
[INFO] I/O exception (java.net.SocketException) caught when processing request: Broken pipe 
[INFO] Retrying request 
Uploading: http://localhost:8080/manager/text/deploy?path=%2FDeviceslCloudWebApp 
2198/6062 KB 
[INFO] I/O exception (java.net.SocketException) caught when processing request: Broken pipe 
[INFO] Retrying request 
Uploading: http://localhost:8080/manager/text/deploy?path=%2FDeviceslCloudWebApp 
2176/6062 KB 
[INFO] I/O exception (java.net.SocketException) caught when processing request: Broken pipe 
[INFO] Retrying request 
Uploading: http://localhost:8080/manager/text/deploy?path=%2FDeviceslCloudWebApp 
2188/6062 KB 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 1.922 s 
[INFO] Finished at: 2016-12-02T20:57:29+01:00 
[INFO] Final Memory: 16M/303M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project DevicesCloudWebApp: Cannot invoke Tomcat manager: Broken pipe -> [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 
+0

をログ。それが正しく起動しない原因となったエラーが存在します。 –

答えて

5

<plugin> 
     <groupId>org.apache.tomcat.maven</groupId> 
     <artifactId>tomcat7-maven-plugin</artifactId> 
     <version>${tomcat7-maven-plugin.version}</version> 
     <configuration> 
      <url>http://localhost:8080/manager/text</url> 
      <server>tomcat</server> 
      <username>admin1</username> 
      <password>admin1</password> 
      <path>/${project.artifactId}</path> 
      <update>true</update> 
     </configuration> 
</plugin> 

以下のアップデートのようにTomcatの中に以下のような役割の設定認証設定を追加してみてください - 私たちは、さらにバックこのエラーで参照する必要があります>$CATALINA_HOME/conf/tomcat-users.xml<tomcat-users>の要素

<role rolename="manager-script"/> 
<role rolename="manager-gui"/> 
<user username="admin" password="admin" roles="manager-gui"/> 
<user username="admin1" password="admin1" roles="manager-script"/> 
関連する問題