0

According to this Spring issue, if you're creating JAR files in Eclipse using the Export... > Java > JAR file wizard, then you have to check the Add directory entries checkbox (unchecked by default) for Spring's component scan to find components in the JAR files.

Auto-wiring annotations in classes from dependent jars

Is there a way to do it for intellij?

Found this answer on stack overflow that give instructions on how to add a directory to the classpath of an application run profile


In Intellij 13, it looks it's slightly different again. Here are the instructions for Intellij 13:

click on the Project view or unhide it by clicking on the "1: Project" button on the left border of the window or by pressing Alt + 1
find your project or sub-module and click on it to highlight it, then press F4, or right click and choose "Open Module Settings" (on IntelliJ 14 it became F12)
click on the dependencies tab
Click the "+" button on the right and select "Jars or directories..."
Find your path and click OK
In the dialog with "Choose Categories of Selected File", choose Classes (even if it's properties), press OK and OK again
You can now run your application and it will have the selected path in the class path

How to add directory to classpath in an application run profile in IntelliJ IDEA?

But I couldn't find choose "Categories of Selected File" anywhere.

0 Answers0