Java Maven项目部署到tomcat8.5.23失败

LorryLu0416 2017-11-20 05:09:01
菜鸟学习java web观摩项目,将项目引入eclipse,按照网上百度的教程搭建环境部署tomcat失败,进得去环境:eclipse oxygen,maven3.3.9,tomcat8.5.23,jdk1.8
maven .setting文件配置:
<server>
<id>tomcat8</id>
<username>admin</username>
<password>admin</password>
</server>
项目pom.xml:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<server>tomcat8</server>
<url>http://localhost:8080/manager/text</url>
<username>admin</username>
<password>admin</password>
<path>/project</path>
<port>8080</port>
</configuration>
</plugin>
tomcat-user.xml配置:
<role rolename="manager"/>
<role rolename="manager-gui"/>
<role rolename="admin"/>
<role rolename="admin-gui"/>
<role rolename="manager-script"/>
<user username="admin" password="admin" roles="admin-gui,admin,manager-gui,manager,manager-script"/>

错误:
Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:redeploy (default-cli) on project fmall-operation: Cannot invoke Tomcat manager: Connection refused: connect -> [Help 1]


控制台:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.fancyedu.mall.operation:fmall-operation:war:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.mybatis.generator:mybatis-generator-maven-plugin is missing. @ line 419, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building fmall-operation 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ fmall-operation ---
[INFO] Deleting D:\teach\project\project\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ fmall-operation ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ fmall-operation ---
[INFO] Compiling 42 source files to D:\teach\project\project\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ fmall-operation ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ fmall-operation ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ fmall-operation ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) @ fmall-operation ---
[INFO] Packaging webapp
[INFO] Assembling webapp [fmall-operation] in [D:\teach\project\project\target\fmall-operation]
[INFO] Processing war project
[INFO] Copying webapp webResources [D:\teach\project\project\src/main/resources/] to [D:\teach\project\project\target\fmall-operation]
[INFO] Copying webapp resources [D:\teach\project\project\src\main\webapp]
[INFO] Building jar: D:\teach\project\project\target\fmall-operation\WEB-INF\lib\fmall-operation-1.0-SNAPSHOT.jar
[INFO] Webapp assembled in [93707 msecs]
[INFO] Building war: D:\teach\project\project\target\fmall-operation.war
[INFO] WEB-INF\web.xml already added, skipping
[INFO]
[INFO] >>> maven-source-plugin:2.1.1:jar (attach-sources) > generate-sources @ fmall-operation >>>
[INFO]
[INFO] <<< maven-source-plugin:2.1.1:jar (attach-sources) < generate-sources @ fmall-operation <<<
[INFO]
[INFO] --- maven-source-plugin:2.1.1:jar (attach-sources) @ fmall-operation ---
[INFO] Building jar: D:\teach\project\project\target\fmall-operation-sources.jar
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ fmall-operation ---
[INFO] Installing D:\teach\project\project\target\fmall-operation.war to d:\tools\.m2\repository\com\fancyedu\mall\operation\fmall-operation\1.0-SNAPSHOT\fmall-operation-1.0-SNAPSHOT.war
[INFO] Installing D:\teach\project\project\pom.xml to d:\tools\.m2\repository\com\fancyedu\mall\operation\fmall-operation\1.0-SNAPSHOT\fmall-operation-1.0-SNAPSHOT.pom
[INFO] Installing D:\teach\project\project\target\fmall-operation-sources.jar to d:\tools\.m2\repository\com\fancyedu\mall\operation\fmall-operation\1.0-SNAPSHOT\fmall-operation-1.0-SNAPSHOT-sources.jar
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.2:redeploy (default-cli) > package @ fmall-operation >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ fmall-operation ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ fmall-operation ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ fmall-operation ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ fmall-operation ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ fmall-operation ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) @ fmall-operation ---
[INFO] Packaging webapp
[INFO] Assembling webapp [fmall-operation] in [D:\teach\project\project\target\fmall-operation]
[INFO] Processing war project
[INFO] Copying webapp webResources [D:\teach\project\project\src/main/resources/] to [D:\teach\project\project\target\fmall-operation]
[INFO] Copying webapp resources [D:\teach\project\project\src\main\webapp]
[INFO] Building jar: D:\teach\project\project\target\fmall-operation\WEB-INF\lib\fmall-operation-1.0-SNAPSHOT.jar
[INFO] Webapp assembled in [27102 msecs]
[INFO] Building war: D:\teach\project\project\target\fmall-operation.war
[INFO] WEB-INF\web.xml already added, skipping
[INFO]
[INFO] >>> maven-source-plugin:2.1.1:jar (attach-sources) > generate-sources @ fmall-operation >>>
[INFO]
[INFO] <<< maven-source-plugin:2.1.1:jar (attach-sources) < generate-sources @ fmall-operation <<<
[INFO]
[INFO] --- maven-source-plugin:2.1.1:jar (attach-sources) @ fmall-operation ---
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.2:redeploy (default-cli) < package @ fmall-operation <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.2:redeploy (default-cli) @ fmall-operation ---
[INFO] Deploying war to http://localhost:8080/fmall-operation
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:57 min
[INFO] Finished at: 2017-11-20T16:49:10+08:00
[INFO] Final Memory: 40M/432M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:redeploy (default-cli) on project fmall-operation: Cannot invoke Tomcat manager: Connection refused: connect -> [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

之后用mvn tomcat7:redeploy部署依然失败,百度了很多次依然没有找到可行的解决办法,下面是错误:


...全文
358 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
LorryLu0416 2018-03-20
  • 打赏
  • 举报
回复
已解决,已解决已解决,感谢
Defonds 2017-11-21
  • 打赏
  • 举报
回复
直接部署? 试试先打包,再部署?

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧