Reputation: 18867
Is it possible to search for a bit of text through the source code of all the maven dependencies of a project?
For example: If you import the following sample maven project: https://github.com/ajorpheus/javadoc-mem-test/tree/search-in-jars, searching for tempHeaders
should turn up AbstractClientHttpRequest.java
as a search result.
Is there a plugin that allows one to do this?
If Intellij does not support this, would you know of an IDE-agnostic way to do this given a maven project? I have looked at tools like jarexplorer but they don't seem to do the job.
Upvotes: 44
Views: 37482
Reputation: 546
I have faced the same problem. There is two way to search in Intellij.
1. Ctrl + shift + F
2. navigate - > search everywhere or use Ctrl + N
To search in external libraries , you have to make sure they are downloaded first in your system then only you can search anything among them.
Upvotes: 2
Reputation: 41
For IntelliJ 2020 go to the main menu, select Navigate | Search Everywhere or press Shift twice to open the search window.
For more information check here: https://www.jetbrains.com/help/idea/searching-everywhere.html#search_all
Upvotes: 1
Reputation: 751
in IntelliJ IDEA 2018, you can do this: ctrl+shift+f
thanks @Ashutosh Jindal
Upvotes: 22
Reputation: 64079
If I understand your requirement correctly, what you are trying to do is possible.
First in the Maven pane you need right click on dependencies and select 'Download Sources'.
Once that is done, follow Ashutosh Jindal instructions to search in your code and the dependencies code.
Upvotes: 9
Reputation: 18867
I found how to do this !
Use the 'Project and Libraries' Custom Scope.
Upvotes: 53