Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In IDEA, after adding a dependency in maven, my artifact always show's the library needs to be 'fixed'

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?

like image 617
Blankman Avatar asked Jun 30 '10 03:06

Blankman


People also ask

How do I fix dependencies in IntelliJ?

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.

Why is IntelliJ not importing Maven dependencies?

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.

What happens when we add dependency in POM xml?

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.


1 Answers

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.

like image 80
Pascal Thivent Avatar answered Oct 12 '22 17:10

Pascal Thivent