tomcat 7 maven plugin snapshot repository issue?

你说的曾经没有我的故事 提交于 2019-12-09 07:03:18

问题


I would like to have tomcat 7 maven plugin, and followed the instruction from [the plugin site][1]. What happened is that it seems to be able to find the tomcat 6.0.29, but not the version 7. I know that because when i tried tomcat:run, the one that was started is the 6.0.29 version.

As far as i know, the plugin for t7 is still in development, thus the snapshot version, and i assumed that i'd need to provide the repo for the snapshot plugin, and i placed

    <pluginRepository>
        <id>tomcat snapshot</id>
        <name>tomcat snapshot</name>
        <url>http://people.apache.org/repo/m2-snapshot-repository/org/apache/tomcat/maven/</url>
    </pluginRepository>

but it doesnt seem to have any changes with my tomcat:run -U (to update the snapshot), still 6.x version running. Here's the output of my 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

Any help would be appreciated ..


回答1:


Try this:

<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



来源:https://stackoverflow.com/questions/7899981/tomcat-7-maven-plugin-snapshot-repository-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!