由 spring-boot-starter-test pom.xml 中的依赖拉取的 Jar

Jars Pulled by dependency spring-boot-starter-test in pom.xml

我已经创建了一个 spring 引导应用程序。

在 pom.xml 中有几个依赖项,它们在 maven 依赖项中拉取了几个 jar。

这里是pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.4.1</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.aciworldwide.tch</groupId>
    <artifactId>bmo</artifactId>
    <version>1.3.1.0-SNAPSHOT</version>
    <name>PmtStsReqApplication</name>
    <description>Generation of xml file with the list of unsettled records from Ipf Trans Log</description>

    <properties>
        <java.version>1.8</java.version>
        <start-class>com.aciworldwide.tch.PmtStsReqApplication</start-class>
        <jaxb-api.version>2.3.1</jaxb-api.version>
    </properties>
    
    <dependencies>
        
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>
        
        <dependency>
            <groupId>com.oracle.ojdbc</groupId>
            <artifactId>ojdbc8</artifactId>
            <version>19.3.0.0</version>
        </dependency>
        
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        
        
        <!-- JAXB 2.3.0 for jdk9+ -->
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>${jaxb-api.version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <version>${jaxb-api.version}</version>
        </dependency>
        <!-- JAXB needs javax.activation module (jdk9) -->
        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>javax.activation-api</artifactId>
            <version>1.2.0</version>
        </dependency>
        
        <dependency>
            <groupId>org.jasypt</groupId>
            <artifactId>jasypt</artifactId>
            <version>1.9.3</version>
        </dependency>
        
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
<packaging>jar</packaging>
</project>

这是构建应用程序后出现的 jar 列表

我想知道依赖项拉取了哪些 jar : spring-boot-starter-test 在构建应用程序时。

知道如何知道pom.xml中提到的依赖项下载了哪些依赖项 jar 会很有帮助。

您可以在命令行上使用 mvn dependency:tree 来查看项目的依赖关系树。使用您的 pom,它输出以下内容:

[INFO] com.aciworldwide.tch:bmo:jar:1.3.1.0-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.4.1:compile
[INFO] |  +- com.zaxxer:HikariCP:jar:3.4.5:compile
[INFO] |  |  \- org.slf4j:slf4j-api:jar:1.7.30:compile
[INFO] |  \- org.springframework:spring-jdbc:jar:5.3.2:compile
[INFO] |     +- org.springframework:spring-beans:jar:5.3.2:compile
[INFO] |     \- org.springframework:spring-tx:jar:5.3.2:compile
[INFO] +- com.oracle.ojdbc:ojdbc8:jar:19.3.0.0:compile
[INFO] |  +- com.oracle.ojdbc:ucp:jar:19.3.0.0:compile
[INFO] |  +- com.oracle.ojdbc:oraclepki:jar:19.3.0.0:compile
[INFO] |  +- com.oracle.ojdbc:osdt_cert:jar:19.3.0.0:compile
[INFO] |  +- com.oracle.ojdbc:osdt_core:jar:19.3.0.0:compile
[INFO] |  +- com.oracle.ojdbc:simplefan:jar:19.3.0.0:compile
[INFO] |  \- com.oracle.ojdbc:ons:jar:19.3.0.0:compile
[INFO] +- org.springframework.boot:spring-boot-starter:jar:2.4.1:compile
[INFO] |  +- org.springframework.boot:spring-boot:jar:2.4.1:compile
[INFO] |  |  \- org.springframework:spring-context:jar:5.3.2:compile
[INFO] |  |     +- org.springframework:spring-aop:jar:5.3.2:compile
[INFO] |  |     \- org.springframework:spring-expression:jar:5.3.2:compile
[INFO] |  +- org.springframework.boot:spring-boot-autoconfigure:jar:2.4.1:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-logging:jar:2.4.1:compile
[INFO] |  |  +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] |  |  |  \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] |  |  +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.13.3:compile
[INFO] |  |  |  \- org.apache.logging.log4j:log4j-api:jar:2.13.3:compile
[INFO] |  |  \- org.slf4j:jul-to-slf4j:jar:1.7.30:compile
[INFO] |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] |  +- org.springframework:spring-core:jar:5.3.2:compile
[INFO] |  |  \- org.springframework:spring-jcl:jar:5.3.2:compile
[INFO] |  \- org.yaml:snakeyaml:jar:1.27:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.4.1:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:2.4.1:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.4.1:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO] |  |  \- net.minidev:json-smart:jar:2.3:test
[INFO] |  |     \- net.minidev:accessors-smart:jar:1.2:test
[INFO] |  |        \- org.ow2.asm:asm:jar:5.0.4:test
[INFO] |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:test
[INFO] |  |  \- jakarta.activation:jakarta.activation-api:jar:1.2.2:test
[INFO] |  +- org.assertj:assertj-core:jar:3.18.1:test
[INFO] |  +- org.hamcrest:hamcrest:jar:2.2:test
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.7.0:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-api:jar:5.7.0:test
[INFO] |  |  |  +- org.apiguardian:apiguardian-api:jar:1.1.0:test
[INFO] |  |  |  +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] |  |  |  \- org.junit.platform:junit-platform-commons:jar:1.7.0:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.7.0:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.7.0:test
[INFO] |  |     \- org.junit.platform:junit-platform-engine:jar:1.7.0:test
[INFO] |  +- org.mockito:mockito-core:jar:3.6.28:test
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.10.18:test
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.10.18:test
[INFO] |  |  \- org.objenesis:objenesis:jar:3.1:test
[INFO] |  +- org.mockito:mockito-junit-jupiter:jar:3.6.28:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] |  +- org.springframework:spring-test:jar:5.3.2:test
[INFO] |  \- org.xmlunit:xmlunit-core:jar:2.7.0:test
[INFO] +- javax.xml.bind:jaxb-api:jar:2.3.1:compile
[INFO] +- org.glassfish.jaxb:jaxb-runtime:jar:2.3.1:compile
[INFO] |  +- org.glassfish.jaxb:txw2:jar:2.3.3:compile
[INFO] |  +- com.sun.istack:istack-commons-runtime:jar:3.0.7:compile
[INFO] |  +- org.jvnet.staxex:stax-ex:jar:1.8:compile
[INFO] |  \- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.15:compile
[INFO] +- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] \- org.jasypt:jasypt:jar:1.9.3:compile

在此输出中,您可以看到 spring-boot-starter-test 及其提供的依赖项:

[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.4.1:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:2.4.1:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.4.1:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO] |  |  \- net.minidev:json-smart:jar:2.3:test
[INFO] |  |     \- net.minidev:accessors-smart:jar:1.2:test
[INFO] |  |        \- org.ow2.asm:asm:jar:5.0.4:test
[INFO] |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:test
[INFO] |  |  \- jakarta.activation:jakarta.activation-api:jar:1.2.2:test
[INFO] |  +- org.assertj:assertj-core:jar:3.18.1:test
[INFO] |  +- org.hamcrest:hamcrest:jar:2.2:test
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.7.0:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-api:jar:5.7.0:test
[INFO] |  |  |  +- org.apiguardian:apiguardian-api:jar:1.1.0:test
[INFO] |  |  |  +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] |  |  |  \- org.junit.platform:junit-platform-commons:jar:1.7.0:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.7.0:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.7.0:test
[INFO] |  |     \- org.junit.platform:junit-platform-engine:jar:1.7.0:test
[INFO] |  +- org.mockito:mockito-core:jar:3.6.28:test
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.10.18:test
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.10.18:test
[INFO] |  |  \- org.objenesis:objenesis:jar:3.1:test
[INFO] |  +- org.mockito:mockito-junit-jupiter:jar:3.6.28:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] |  +- org.springframework:spring-test:jar:5.3.2:test
[INFO] |  \- org.xmlunit:xmlunit-core:jar:2.7.0:test