views:

29

answers:

2

So every time I add a dependancy to a library using maven in my pom.xml, it doesn't get deployed until I go to module settings and then click on 'fix'.

This happend when I added freemarker.

Why doesn't IDEA do this for me? Am I missing a step?

+1  A: 

IDEA stores all of your module's dependencies in either a .iml or .classpath file (based on your preference).

When you change the pom.xml file, it needs to resolve the new set of dependencies (Re-import) and update the file accordingly. I can only imagine that they don't do this automatically for you because they can never really know when you are done working with the file, and causing resolution of dependencies to start while you're still typing would make working with pom.xml from within idea very irritating.

AFAIK, you're doing it right. In my version of IDEA, I see a "re-import" button that appears in the pom file editor (which saves a couple of clicks)... or you can go to the "Maven Projects" window and click the "Re-Import Maven Projects" button, but these should do the same thing as your "Fix" button in the project settings.

Michael D
+1  A: 

Not sure about previous versions but with IntelliJ 9, IntelliJ shows me a Import Changes link when I modify a pom.xml and also offers to Enable Auto-Import:

alt text

The auto-import option is also available from the Maven Integration dialog: File > Settings > Maven > Importing > Import Maven projects automatically.

Pascal Thivent
nice tip thanks. hey are you running ubuntu? native or vm (just curiuos)
Blankman
@Blankman Yes, I'm using Ubuntu (as main OS), running others as VM when I have too (mostly for testing).
Pascal Thivent