zoukankan      html  css  js  c++  java
  • tomcat-maven-plugin在pom.xml中的配置

    tomcat-maven-plugin在pom.xml中的配置
    https://blog.csdn.net/TSDDragon/article/details/38686277

    1、使用tomcat-maven-plugin需要在pom.xml文件中project>build节点下添加以下代码:

     <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.tomcat.maven</groupId>
              <artifactId>tomcat6-maven-plugin</artifactId>
              <version>2.3-SNAPSHOT</version>
            </plugin>
            <plugin>
              <groupId>org.apache.tomcat.maven</groupId>
              <artifactId>tomcat7-maven-plugin</artifactId>
              <version>2.3-SNAPSHOT</version>
            </plugin>
          </plugins>
        </pluginManagement>
    2、添加仓库信息,保证maven可以从仓库中下载到tomcat-maven-plugin插件

    (a)在project>repositories节点下加如下配置信息

    1. <repository>
    2. <id>people.apache.snapshots</id>
    3. <url>
    4. http://repository.apache.org/content/groups/snapshots-group/
    5. </url>
    6. <releases>
    7. <enabled>false</enabled>
    8. </releases>
    9. <snapshots>
    10. <enabled>true</enabled>
    11. </snapshots>
    12. </repository>

    (b)在project>pluginRepositories下添加如下配置信息

    1. <pluginRepository>
    2. <id>apache.snapshots</id>
    3. <name>Apache Snapshots</name>
    4. <url>
    5. http://repository.apache.org/content/groups/snapshots-group/
    6. </url>
    7. <releases>
    8. <enabled>false</enabled>
    9. </releases>
    10. <snapshots>
    11. <enabled>true</enabled>
    12. </snapshots>
    13. </pluginRepository>

    正确的pom.xml文件为:

    1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    2. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    3. <modelVersion>4.0.0</modelVersion>
    4. <groupId>MavenHelloWorld</groupId>
    5. <artifactId>MavenHelloWorld</artifactId>
    6. <packaging>war</packaging>
    7. <version>0.0.1-SNAPSHOT</version>
    8. <name>MavenHelloWorld Maven Webapp</name>
    9. <url>http://maven.apache.org</url>
    10. <dependencies>
    11. <dependency>
    12. <groupId>junit</groupId>
    13. <artifactId>junit</artifactId>
    14. <version>3.8.1</version>
    15. <scope>test</scope>
    16. </dependency>
    17. </dependencies>
    18. <repositories>
    19. <repository>
    20. <id>people.apache.snapshots</id>
    21. <url>
    22. http://repository.apache.org/content/groups/snapshots-group/
    23. </url>
    24. <releases>
    25. <enabled>false</enabled>
    26. </releases>
    27. <snapshots>
    28. <enabled>true</enabled>
    29. </snapshots>
    30. </repository>
    31. </repositories>
    32. <pluginRepositories>
    33. <pluginRepository>
    34. <id>apache.snapshots</id>
    35. <name>Apache Snapshots</name>
    36. <url>
    37. http://repository.apache.org/content/groups/snapshots-group/
    38. </url>
    39. <releases>
    40. <enabled>false</enabled>
    41. </releases>
    42. <snapshots>
    43. <enabled>true</enabled>
    44. </snapshots>
    45. </pluginRepository>
    46. </pluginRepositories>
    47. <build>
    48. <finalName>MavenHelloWorld</finalName>
    49. <pluginManagement>
    50. <plugins>
    51. <plugin>
    52. <groupId>org.apache.tomcat.maven</groupId>
    53. <artifactId>tomcat6-maven-plugin</artifactId>
    54. <version>2.0-SNAPSHOT</version>
    55. <configuration>
    56. <url>http://localhost:8080/manager/text</url>
    57. <server>tomcat</server>
    58. </configuration>
    59. </plugin>
    60. <plugin>
    61. <groupId>org.apache.tomcat.maven</groupId>
    62. <artifactId>tomcat7-maven-plugin</artifactId>
    63. <version>2.0-SNAPSHOT</version>
    64. <configuration>
    65. <url>http://localhost:8080/manager/text</url>
    66. <server>tomcat</server>
    67. </configuration>
    68. </plugin>
    69. </plugins>
    70. </pluginManagement>
    71. </build>
    72. </project>


  • 相关阅读:
    .net framework 3.5 beta 2 / vs 2008 beta 2 有问题!
    提交了 VS 2008 sp1 对 Linq to SQL 的 xml 字段类型支持的一个 bug
    如何在 vista 的 iis 7 上面配置 asp.net 1.1 开发环境
    Linq to sql 中如何进行 left join
    Silverlight 2 beta 2 中目前不支持共享 WCF 的客户端类型
    Scott Guthrie 写的 Silverlight 教程索引
    利用 Xml Literal 功能复制一段 Xml
    Silverlight 2 beta 2 bug 解决办法 (持续更新中)
    C++使用内存映射文件入门
    如何在C++项目中引用Lib文件(VS2005)
  • 原文地址:https://www.cnblogs.com/sunny3158/p/15378496.html
Copyright © 2011-2022 走看看