2

Hi I am trying to port a mid sized Maven project to IntelliJ Idea 12 (from Eclipse).

There are around 30 different modules in the project.

I am running an MVN install on each module via IntelliJ lifecycle management. The jars are being correctly generated, and deposited into my local repository directory. It is also correctly picking up the third party libraries.

However IntelliJ is sometimes requiring me to then add the generated jars to my classpath as a dependency. (It is not enough to simply say "Add Maven Dependency", I have to physically add the generated jar as a library.)

In other cases it works correctly. Not sure why it is not consistent.

Victor Grazi
  • 15,563
  • 14
  • 61
  • 94
  • 3
    It would be better to have a parent pom that defines the dependencies between the modules so that IDEA uses modules for resolving instead of repository jars, otherwise you would have to reimport Maven projects to update the dependencies. Also check that you are using IDEA 12.1. If Maven 3 is used, enable the corresponding setting in IDEA `Settings | Maven | Importing`. – CrazyCoder Apr 09 '13 at 19:47
  • when you open several modules inside one project intellij is picky about adding all the poms from the modules as maven build files (right click them) - hope this helps – user2088476 Apr 09 '13 at 19:48
  • Is this related to reloading the pom.xml when you manually changed it? I posted this as a separate question, but maybe this is what causes your problem as well. http://stackoverflow.com/questions/16992255/how-can-i-make-intellij-update-my-dependencies-from-maven/16992262#16992262 – Jan H Jun 07 '13 at 20:17

1 Answers1

1

Have you tried updating the local Maven repository in IntelliJ IDEA? You can do so by opening Preferences->Maven->Repositories, than select your local repository and click on 'Update'.

pczora
  • 321
  • 1
  • 2
  • 11