Is there any way in IDEA to force Maven snapshots to reindex?

We have a large multi-module Maven project. The usual working style is to check out a few modules you are interested in, and for the other modules they depend on, use the JAR snapshot files provided by Maven.

It basically works; when we need updated snapshots we just force reimport from the "Maven Projects" tab. However, re-imported snapshots never return.

Steps to play:

  • In one project, check / configure a module, which depends on the Maven snapshot of another module.
  • In a separate project, make changes to this other module, for example. adding a method and deploying it to the Maven repository.
  • In the first project, update the snapshot.
  • In the first project, write code that calls the new method.

Expected:

  • Unable to call new method.

Actual:

  • The method call is redirected with the error "Unable to resolve the method." However:
    • Code is compiled (via assembly or context menu)
    • Code runs, including code that calls a new method

Is there any way around this? It would be nice to get rid of the red line, have autocomplete, etc. Work and generally be able to continue to use IDEA as you expected.

, Eclipse IDEA, , Eclipse/Maven, updatePolicy "" pom.xml. , , IDEA ( : ) , , .

( "" , , : , VCS . , POM . , "", Eclipse .)

+3
3

"synchronize" ( ) - , IDEA JAR . ...

( maven JAR, IDEA JAR . , , maven)

+2

, , , updatePolicy . , , ? , IDEA . maven pom, , IDEA.

, in() . Eclipse. M2Eclipse? , "" . , . .

0

:

> , , > > Maven >

() "".

This re-indexing and searching for the newly added class in the dependency bar worked, and IntelliJ suggested an artifact and related imports.

0
source

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


All Articles