maven tomcat7插件热部署问题

时间:2022-09-16 21:22:28
最近在做一个项目,为了提高效率,采用maven的热部署,
我tomcat配置如下:
<role rolename="manager-gui"/>
  <role rolename="manager-script"/>
  <user username="admin" password="tomcat" roles="manager-gui,manager-script"/>
</tomcat-users>

maven插件配置如下:
 <build>
   <plugins>
   <plugin>
   <groupId>org.apache.tomcat.maven</groupId>
   <artifactId>tomcat7-maven-plugin</artifactId>
   <configuration>
   <port>8080</port>
   <url>http://localhost:8090/manager/text</url>
       <path>/dhh</path>
       <server>tomcat</server>
       <username>admin</username>
       <password>tomcat</password>
   </configuration>
   </plugin>
   </plugins>
  </build>

然后 启动部署的tomcat 点击maven build 输入tomcat7:redeploy 
第一次部署成功。
第二次出现
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] acme-manager
[INFO] acme-manager-pojo
[INFO] acme-manager-mapper
[INFO] acme-manager-service
[INFO] acme-manager-web
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building acme-manager 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> tomcat7-maven-plugin:2.2:redeploy (default-cli) @ acme-manager >>>
[INFO] 
[INFO] <<< tomcat7-maven-plugin:2.2:redeploy (default-cli) @ acme-manager <<<
[INFO] 
[INFO] --- tomcat7-maven-plugin:2.2:redeploy (default-cli) @ acme-manager ---
[INFO] Skipping non-war project
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building acme-manager-pojo 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> tomcat7-maven-plugin:2.2:redeploy (default-cli) @ acme-manager-pojo >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ acme-manager-pojo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ acme-manager-pojo ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ acme-manager-pojo ---
[INFO] Not copying test resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ acme-manager-pojo ---
[INFO] Not compiling test sources
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ acme-manager-pojo ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ acme-manager-pojo ---
[INFO] 
[INFO] <<< tomcat7-maven-plugin:2.2:redeploy (default-cli) @ acme-manager-pojo <<<
[INFO] 
[INFO] --- tomcat7-maven-plugin:2.2:redeploy (default-cli) @ acme-manager-pojo ---
[INFO] Skipping non-war project
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building acme-manager-mapper 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> tomcat7-maven-plugin:2.2:redeploy (default-cli) @ acme-manager-mapper >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ acme-manager-mapper ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ acme-manager-mapper ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ acme-manager-mapper ---
[INFO] Not copying test resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ acme-manager-mapper ---
[INFO] Not compiling test sources
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ acme-manager-mapper ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ acme-manager-mapper ---
[INFO] 
[INFO] <<< tomcat7-maven-plugin:2.2:redeploy (default-cli) @ acme-manager-mapper <<<
[INFO] 
[INFO] --- tomcat7-maven-plugin:2.2:redeploy (default-cli) @ acme-manager-mapper ---
[INFO] Skipping non-war project
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building acme-manager-service 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> tomcat7-maven-plugin:2.2:redeploy (default-cli) @ acme-manager-service >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ acme-manager-service ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ acme-manager-service ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ acme-manager-service ---
[INFO] Not copying test resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ acme-manager-service ---
[INFO] Not compiling test sources
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ acme-manager-service ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ acme-manager-service ---
[INFO] 
[INFO] <<< tomcat7-maven-plugin:2.2:redeploy (default-cli) @ acme-manager-service <<<
[INFO] 
[INFO] --- tomcat7-maven-plugin:2.2:redeploy (default-cli) @ acme-manager-service ---
[INFO] Skipping non-war project
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building acme-manager-web 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> tomcat7-maven-plugin:2.2:redeploy (default-cli) @ acme-manager-web >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ acme-manager-web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 16 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ acme-manager-web ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ acme-manager-web ---
[INFO] Not copying test resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ acme-manager-web ---
[INFO] Not compiling test sources
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ acme-manager-web ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-war-plugin:2.2:war (default-war) @ acme-manager-web ---
[INFO] Packaging webapp
[INFO] Assembling webapp [acme-manager-web] in [/java/workspace/acme-manager/acme-manager-web/target/acme-manager-web]
[INFO] Processing war project
[INFO] Copying webapp resources [/java/workspace/acme-manager/acme-manager-web/src/main/webapp]
[INFO] Webapp assembled in [486 msecs]
[INFO] Building war: /java/workspace/acme-manager/acme-manager-web/target/acme-manager-web.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] 
[INFO] <<< tomcat7-maven-plugin:2.2:redeploy (default-cli) @ acme-manager-web <<<
[INFO] 
[INFO] --- tomcat7-maven-plugin:2.2:redeploy (default-cli) @ acme-manager-web ---
[INFO] Deploying war to http://localhost:8090/dhh  
Uploading: http://localhost:8090/manager/text/deploy?path=%2Fdhh&update=true
Uploaded: http://localhost:8090/manager/text/deploy?path=%2Fdhh&update=true (26015 KB at 107945.2 KB/sec)

然后就到这里,就不往下走了,网站此时也访问不了,求助。

1 个解决方案

#1


解决了吗 我也是一样的问题

#1


解决了吗 我也是一样的问题