How does the IntelliJ Reimport All Maven Projects button work?

How does the IntelliJ Reimport All Maven Projects button actually work?

I ask this because I see that the behavior of the -UIntelliJ button is different from the behavior when I run a command mvnwith an argument -U, and I don’t understand why.

+6
source share
2 answers

I think you missed the part with local and remote repository.

If you run it mvn -U, it forces maven to download all the libraries from the remote repository, which will be your nexus or maven repo company. The main difference from -Uand without -Uoverriding your local SNAPSHOT banks with remote SNAPSHOT banks. Local SNAPSHOT banks came from the installation, and remote access from the deployment team.

There will be confusion with reimport. Reimport will load your local banks instead of remote banks, especially SNAPSHOT. You can enable the forced update snapshot in the maven menu, which will enable the switch -Uin intellij.

, .m2 maven intellij maven. maven. mvn -X .

[DEBUG] Reading global settings from /usr/local/Cellar/maven/3.3.9/libexec/conf/settings.xml
[DEBUG] Reading user settings from /Users/xbaran/.m2/settings.xml
[DEBUG] Reading global toolchains from /usr/local/Cellar/maven/3.3.9/libexec/conf/toolchains.xml
[DEBUG] Reading user toolchains from /Users/xbaran/.m2/toolchains.xml
[DEBUG] Using local repository at /Users/xbaran/.m2/repository

enter image description here


reimport, .

, - IntelliJ (.. .idea). mvn clean install -U , , IntelliJ IDE; - . , "magic reimport", .

, reimport IntelliJ , .

+6

pom.xml, IDEA . , , IDEA .

, "Maven > Reimport" - reimport maven. maven .

"Reimport " , maven .

, , " > , , > > Maven > " " Maven ". pom.xml "Reimport".

0

Source: https://habr.com/ru/post/1606612/


All Articles