0

I'm working on a project in Intellij IDEA which is divided into several Maven modules. Moreover I configured these modules as WAR artifacts, so they can be deployed to a Tomcat 8 independently. During development I recognized a behavior I couldn't solve so far: If I add/remove a dependency in a module's pom.xml these changes are not considered in the lib-directory of my final artifact, leading to ClassNotFoundExceptions on server startup and so on. The only solution that came up to me is to fix these changes in my artifact settings manually, which works but seems not very handy to me. Is there any way to configure IntelliJ to synchronize an atrifact's lib folder with Maven dependencies automatically?

Sorry in case of duplication. I already found questions related to this one, but these solutions as well as the JetBrains docs have not been successful so far.

Thank for helping me!

pklndnst
  • 726
  • 2
  • 10
  • 27
  • see this: http://stackoverflow.com/questions/26099526/how-to-disable-maven-auto-import-automatically-in-intellij-idea (you want to enable it) –  May 05 '15 at 13:56
  • @RC Thanks for help. I had this option already enabled. The dependencies itselves are updated properly, I think it's not a Maven issue. Still the artifacts aren't aware of dependecy changes, – pklndnst May 05 '15 at 14:05
  • Have you tried cleaning and rebuilding the artifacts (Build->Build Artifacts)? – pens-fan-69 May 05 '15 at 14:42
  • @pens-fan-69 Yes, I already tried, but same effect. Inspecting the module shows that a e.g. a new dependency is recognized and added, but the WAR artifact's lib folder isn't up to date... – pklndnst May 05 '15 at 14:54

1 Answers1

0

Finally got it. The problem arises if you create WAR artifacts 'manually'. Because IntelliJ uses pom.xml to configure artifacts automatically, including war makes IDEA creating all necessary artifacts for you. These are always up to date with your Maven dependencies.

pklndnst
  • 726
  • 2
  • 10
  • 27