Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I force Idea and Maven download all sources for my project?

My Java project is build with Maven and written with the help of Intellij Idea. I have a lot of open-source project dependencies and I want to study them extensively to understand how they work. For this I often use a usage search in Idea, i.e. Find Usages option, which tells me where the usages of some class can be found. Also it can be Find In Path option, or some other code navigation tool.

The problem is that I am not sure all the sources are downloaded. Thats why my search may give wrong results.

A question is : how can I force Idea and Maven download all the sources for my project and make all my searches complete ?

like image 291
MiamiBeach Avatar asked Mar 22 '15 20:03

MiamiBeach


People also ask

How do I force Maven to download dependencies?

We can use -U/--update-snapshots flag when building a maven project to force maven to download dependencies from the remote repository. Here, -U,--update-snapshots : Forces a check for missing releases and updated snapshots on remote repositories.

Why Maven dependencies are not getting downloaded in IntelliJ?

If the dependencies weren't imported correctly (IntelliJ IDEA highlights them), try to perform the following actions: You can check your local maven repository in the Maven | Repositories settings and try to update it. You can check the jar file of the local . m2 repository to see if it was downloaded correctly.


2 Answers

In the 'Maven Projects' tab on the side of the Idea window is a toolbar button (looks like a box with a green arrow pointing down) for downloading sources and documentation.

like image 155
Nicholas Daley-Okoye Avatar answered Nov 07 '22 15:11

Nicholas Daley-Okoye


In IntelliJ 2018.2.3 Ultimate Edition, click on "Maven Projects" on the right hand side of the window (vertical text alignment). Then click the third button on the left in the toolbar (arrow pointing down to a horizontal line- not green for me).

like image 1
gooboo Avatar answered Nov 07 '22 15:11

gooboo