So every time I add a dependency 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 happened when I added freemarker.
Why doesn't IDEA do this for me? Am I missing a step?
In the Dependencies tool window, in the search field, start typing the name of your dependency. In the list of results select the one you need and click Add. For more information on working with the Dependencies tool window, refer to Package Search. IntelliJ IDEA adds the dependency to your pom.
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.
Maven will download the new dependencie(s) to your local repository and then use this to compile your JAR. If you are packaging your application as a web archive (WAR file), it would include the binaries of the dependency (and any binaries it depends on) in your WAR file. Save this answer.
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 http://www.imagebanana.com/img/emcut3ku/screenshot_008.png
The auto-import option is also available from the Maven Integration dialog: File > Settings > Maven > Importing > Import Maven projects automatically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With