What's the correct procedure to add JARs into WEB-INF/lib directory in IntelliJ

user1902183 picture user1902183 · Nov 6, 2013 · Viewed 10.5k times · Source

Say I have a Java web project and I need to place a couple of JARs into the WEB-INF/lib directory. In Eclipse, if you simply place those JARs there, Eclipse picks them up as on the classpath. However, IntelliJ doesn't seem to.

What is the correct way of adding those JARs into the project such that they are in the standard WEB-INF/lib directory?

Answer

Anton Kaiser picture Anton Kaiser · Nov 20, 2014

In the Project Structure window, after adding the JAR in the section "Libraries", you can go to the section "Artifacts" and you'll see in the register "Output Layout" how the WEB-INF folder will look like. On the right side you see "Available Elements", which you can drag&drop to the left site into the lib folder.