我想拥有tomcat 7 maven插件,并按照[插件网站] [1]的说明进行操作。 发生了什么事情似乎能够找到tomcat 6.0.29,而不是版本7。 我知道,因为当我尝试tomcat:run时,启动的那个是6.0.29版本。
据我所知,t7的插件仍处于开发阶段,因此是快照版本,我认为我需要为快照插件提供repo,并且我放置了
<pluginRepository>
<id>tomcat snapshot</id>
<name>tomcat snapshot</name>
<url>http://people.apache.org/repo/m2-snapshot-repository/org/apache/tomcat/maven/</url>
</pluginRepository>
但是我的tomcat似乎没有任何变化:运行-U(更新快照),仍然运行6.x版本。这是我的mvn tomcat的输出:info -U:
C:\Users\albert\workspace\BasicSetup>mvn tomcat:info -U
[INFO] Scanning for projects...
Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/tomcat/maven/org/apache
/tomcat/maven/tomcat7-maven-plugin/2.0-SNAPSHOT/maven-metadata.xml
Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/tomcat/maven/org/apache
/tomcat/maven/tomcat7-maven-plugin/2.0-SNAPSHOT/maven-metadata.xml
Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/tomcat/maven/org/apache
/tomcat/maven/tomcat7-maven-plugin/2.0-SNAPSHOT/tomcat7-maven-plugin-2.0-SNAPSHOT.pom
[WARNING] The POM for org.apache.tomcat.maven:tomcat7-maven-plugin:jar:2.0-SNAPSHOT is missing, no d
ependency information available
[WARNING] Failed to retrieve plugin descriptor for org.apache.tomcat.maven:tomcat7-maven-plugin:2.0-
SNAPSHOT: Plugin org.apache.tomcat.maven:tomcat7-maven-plugin:2.0-SNAPSHOT or one of its dependencie
s could not be resolved: Failed to read artifact descriptor for org.apache.tomcat.maven:tomcat7-mave
n-plugin:jar:2.0-SNAPSHOT
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/tomcat/maven/org/codeha
us/mojo/maven-metadata.xml
Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/tomcat/maven/org/apache
/maven/plugins/maven-metadata.xml
Downloaded: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml (11 KB at 6.1
KB/sec)
Downloaded: http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml (18 KB at 10.7 KB/sec
)
Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/tomcat/maven/org/codeha
us/mojo/tomcat-maven-plugin/maven-metadata.xml
Downloading: http://repo1.maven.org/maven2/org/codehaus/mojo/tomcat-maven-plugin/maven-metadata.xml
Downloaded: http://repo1.maven.org/maven2/org/codehaus/mojo/tomcat-maven-plugin/maven-metadata.xml (
439 B at 0.1 KB/sec)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building BasicSetup Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/tomcat/maven/org/apache
/tomcat/maven/tomcat7-maven-plugin/2.0-SNAPSHOT/tomcat7-maven-plugin-2.0-SNAPSHOT.pom
[WARNING] The POM for org.apache.tomcat.maven:tomcat7-maven-plugin:jar:2.0-SNAPSHOT is missing, no d
ependency information available
[WARNING] Failed to retrieve plugin descriptor for org.apache.tomcat.maven:tomcat7-maven-plugin:2.0-
SNAPSHOT: Plugin org.apache.tomcat.maven:tomcat7-maven-plugin:2.0-SNAPSHOT or one of its dependencie
s could not be resolved: Failed to read artifact descriptor for org.apache.tomcat.maven:tomcat7-mave
n-plugin:jar:2.0-SNAPSHOT
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/tomcat/maven/org/codeha
us/mojo/maven-metadata.xml
Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/tomcat/maven/org/apache
/maven/plugins/maven-metadata.xml
Downloading: http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloaded: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml (11 KB at 6.0
KB/sec)
Downloaded: http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml (18 KB at 4.4 KB/sec)
Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/tomcat/maven/org/codeha
us/mojo/tomcat-maven-plugin/maven-metadata.xml
Downloading: http://repo1.maven.org/maven2/org/codehaus/mojo/tomcat-maven-plugin/maven-metadata.xml
Downloaded: http://repo1.maven.org/maven2/org/codehaus/mojo/tomcat-maven-plugin/maven-metadata.xml (
439 B at 0.2 KB/sec)
[INFO]
[INFO] --- tomcat-maven-plugin:1.1:info (default-cli) @ BasicSetup ---
[INFO] Listing server information at http://localhost:8080/manager
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.348s
[INFO] Finished at: Wed Oct 26 14:28:40 ICT 2011
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:info (default-cli) on proje
ct BasicSetup: 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 arti
cles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
任何帮助将不胜感激..
答案 0 :(得分:12)
试试这个:
<pluginRepository>
<id>apache.snapshots</id>
<name>Apache Snapshots</name>
<url>http://people.apache.org/repo/m2-snapshot-repository</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/snapshot-test.html