首页 > 解决方案 > Maven包含依赖删除一个

问题描述

这是我pom.xml在我的电脑中的一个 JAR 的位置。

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>net.onima</groupId>
  <artifactId>onimaapi</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>OnimaAPI</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.source>1.8</maven.compiler.source>
  </properties>

  <dependencies>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.zaxxer</groupId>
      <artifactId>HikariCP</artifactId>
      <version>2.7.8</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.github.paperspigot</groupId>
      <artifactId>paperspigot</artifactId>
      <version>1.7.10-R0.1-SNAPSHOT</version>
      <scope>system</scope>
      <systemPath>C:\Users\Jules\Desktop\Serveur Local\paperspigot-1.7.10-R0.1-SNAPSHOT.jar</systemPath>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <configuration>
          <filters>

            <filter>
              <artifact>com.zaxxer:HikariCP</artifact>
              <includes>
                <include>**</include>
              </includes>
            </filter>


          </filters>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>

当我设置过滤器以便可以将 HikariCP 添加到我的 jar 中时,与我的 PC 中的 jar 相关的依赖项将被删除,因此我无法全新安装。我不明白为什么,有人可以为我解释一下吗?我对 maven 很陌生,但仍在努力。

标签: javamavenhikaricp

解决方案


推荐阅读