maven-插件问腿

Tomcat7

  • 插件

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    <build>
    <plugins>

    <plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>2.1</version>
    <configuration>
    <port>9000</port>
    <path>/</path>
    </configuration>
    </plugin>
    </plugins>
    </build>
  • 运行

    1
    mvn tomcat7:run
    启动入口 mvnd=>mvn

Tomcat8

  • 插件下载

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32

    <pluginRepositories>
    <pluginRepository>
    <id>alfresco-public</id>
    <url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
    </pluginRepository>
    <pluginRepository>
    <id>alfresco-public-snapshots</id>
    <url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
    <snapshots>
    <enabled>true</enabled>
    <updatePolicy>daily</updatePolicy>
    </snapshots>
    </pluginRepository>
    <pluginRepository>
    <id>beardedgeeks-releases</id>
    <url>http://beardedgeeks.googlecode.com/svn/repository/releases</url>
    </pluginRepository>
    </pluginRepositories>
    <build>
    <plugins>
    <plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat8-maven-plugin</artifactId>
    <version >3.0-r1655215</version>
    <configuration >
    <path>/</path>
    <port>9090</port>
    </configuration>
    </plugin>
    </plugins>
    </build>
  • 启动失败,可以下载

消失的依赖

  • 依赖

    (2022.1.3)消失的依赖
  • 解决

    1. 复制pom.xml 的内容,之后删除,以创建文件方式创建

    2. 添加该项目为maven

      新建的pom,不识别为maven 项目 重新添加为maven 项目,刷新后右侧显示依赖
    3. 自定义maven 命令

      maven helper 修改mvnd => mvn

Zookeeper 客户端依赖

  • 复合依赖

    1
    2
    3
    4
    5
    6
    <dependency>
    <groupId>org.apache.dubbo</groupId>
    <artifactId>dubbo-dependencies-zookeeper</artifactId>
    <version>2.7.8</version>
    <type>pom</type>
    </dependency>
  • 独立

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    <dependency>
    <groupId>org.apache.curator</groupId>
    <artifactId>curator-framework</artifactId>
    <version>2.8.0</version>
    </dependency>
    <dependency>
    <groupId>org.apache.curator</groupId>
    <artifactId>curator-recipes</artifactId>
    <version>2.8.0</version>
    </dependency>