Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
250 views
in Technique[技术] by (71.8m points)

java - How to check that where in the Spring boot project (Intellij Idea), particular maven dependency is used?

In the pom.xml file there are many dependencies are added. I want to check one particular dependency is used where in the whole project. I am using Intellij Idea for Spring Boot project. Project is too big to check each file manually. I want to check where the below dependency is used in the project?

<dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>19.0</version>
</dependency>
question from:https://stackoverflow.com/questions/65936399/how-to-check-that-where-in-the-spring-boot-project-intellij-idea-particular-m

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Two ways :

First :

CTRL+shift+F and search for "com.google.guava". This will give you all the files where classes from this package has been imported.

Second :

Remove the dependency from pom.xml. And reload your pom changes.

This will remove your library from classpath. As soon as this happens, your IDE will start showing red lines under all the classes where your dependency has been used as it'll not find classes from your library mentioned in imports.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...