由于您拥有POM,这意味着您正在使用Maven,并且Maven拥有一个名为dependency的插件,您可以在其上调用
dependency:list该插件,该插件将列出所有jar依赖项及其版本。
只需在项目的根目录中调用(假设您使用的是启动器):
./mvnw dependency:list
您将列出您的jar:
[INFO] ------------------------------------------------------------------------[INFO] Building XXXXXXX 0.0.2-SNAPSHOT[INFO] ------------------------------------------------------------------------[INFO] [INFO] --- maven-dependency-plugin:2.10:list (default-cli) @ xxxxxxx ---[INFO] [INFO] The following files have been resolved:[INFO] org.apache.lucene:lucene-backward-precs:jar:5.5.2:compile[INFO] org.springframework.boot:spring-boot-starter-jdbc:jar:1.5.1.RELEASE:compile
你也可以使用
dependency:analyze-duplicate,
dependency:tree或者
dependency:analyze-report检查一切声明一次。检查此插件的文档,当您遇到依赖关系问题时,它确实很有用。
这是dependency:tree的示例:
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ ouaknine ---[INFO] com.rdlopes.ouaknine:ouaknine:war:0.0.2-SNAPSHOT[INFO] +- com.fasterxml.jackson.datatype:jackson-datatype-hibernate5:jar:2.8.6:compile[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.6:compile[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.8.6:compile[INFO] | - javax.transaction:jta:jar:1.1:compile[INFO] +- com.fasterxml.jackson.datatype:jackson-datatype-hppc:jar:2.8.6:compile[INFO] | - com.carrotsearch:hppc:jar:0.7.1:compile[INFO] +- com.fasterxml.jackson.datatype:jackson-datatype-json-org:jar:2.8.6:compile[INFO] | - org.apache.geronimo.bundles:json:jar:20090211_1:compile[INFO] +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.8.6:compile[INFO] | - com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile[INFO] +- com.h2database:h2:jar:1.4.193:compile[INFO] +- com.jayway.jsonpath:json-path:jar:2.2.0:test[INFO] | +- net.minidev:json-smart:jar:2.2.1:test[INFO] | | - net.minidev:accessors-smart:jar:1.1:test[INFO] | | - org.ow2.asm:asm:jar:5.0.3:test[INFO] | - org.slf4j:slf4j-api:jar:1.7.22:compile[INFO] +- com.jcraft:jzlib:jar:1.1.3:compile[INFO] +- com.mattbertolini:liquibase-slf4j:jar:2.0.0:compile[INFO] +- com.ryantenney.metrics:metrics-spring:jar:3.1.3:compile[INFO] | +- io.dropwizard.metrics:metrics-healthchecks:jar:3.1.2:compile[INFO] | +- org.springframework:spring-core:jar:4.3.6.RELEASE:compile[INFO] | +- org.springframework:spring-beans:jar:4.3.6.RELEASE:compile[INFO] | - org.springframework:spring-aop:jar:4.3.6.RELEASE:compile[INFO] +- com.zaxxer:HikariCP:jar:2.6.0:compile[INFO] +- commons-io:commons-io:jar:2.5:compile[INFO] +- io.dropwizard.metrics:metrics-annotation:jar:3.1.2:compile[INFO] +- io.dropwizard.metrics:metrics-core:jar:3.1.2:compile[INFO] +- io.dropwizard.metrics:metrics-json:jar:3.1.2:compile
在我的MacBook Pro上,我只需在终端中致电:
macbook-pro-de-rui:ouaknine rui$ ./mvnw dependency:list | grep jpa[INFO] org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile[INFO] org.springframework.data:spring-data-jpa:jar:1.11.0.RELEASE:compile[INFO] org.springframework.boot:spring-boot-starter-data-jpa:jar:1.5.1.RELEASE:compile
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)