我有Maven项目和Tomcat服务器。 我在IDEA工作,当我点击 “Maven的LifeCicle” - > “部署”,我有一个问题:将maven项目部署到tomcat
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ TestMaven ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.035 s
[INFO] Finished at: 2014-09-20T13:52:32+04:00
[INFO] Final Memory: 11M/93M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project TestMaven: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [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
我的pom.xml我喜欢的是:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<server>tomcat</server>
<url>http://localhost:8080/manager/text</url>
</configuration>
</plugin>
没有工作或:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
</plugin>
也没有工作。
根据输出,你没有部署到Tomcat,你正在部署到Maven存储库。可能你的pom会错过'distributionManagement'部分。请参阅[这里](http://maven.apache.org/plugins/maven-deploy-plugin/usage.html)。 – 2014-09-20 10:04:59