We have a large multi-module Maven project. The usual working style is to check out a few modules you're interested in, and for the other modules they depend on, use snapshot JARs provided by Maven.
This mostly seems to work; when we need updated snapshots, we just force a reimport from the "Maven Projects" tab. However, the reimported snapshots never seem to get reindexed.
Steps to reproduce:
- In one project, check out / configure a module that depends on a Maven snapshot of some other module.
- In a separate project, make a change to that other module, e.g. adding a method, and deploy it to the Maven repository.
- In the first project, update the snapshot.
- In the first project, write some code that calls the new method.
Expected:
- No trouble calling the new method.
Actual:
- Method call is redlined with "Cannot resolve method" error. However:
- Code does compile (via the Build or context menu)
- Code does run, including code that calls the new method
Is there some way around this? It would be nice to get rid of the redline, have autocomplete etc. work, and in general be able to continue to use IDEA the way you're supposed to.
Possibly relevant: We have a mix of Eclipse and IDEA developers, and in order to work around some Eclipse/Maven integration bugs, we've set the snapshot updatePolicy to "never" in our pom.xml files. However, I would expect the IDEA setting (Snapshot update policy: Always update) to override this, unless I misunderstand what the setting does.
("Never" might seem counterintuitive, but I think it's correct for developers: update dependencies manually, just as you update source code from the VCS manually. For real builds, we have Hudson override the POM settings anyway. And more importantly, setting it to "never" stops Eclipse from rabid unnecessary total recompiles.)