Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude folder with sources which are built in IntelliJ Idea

I open maven project in Idea. I store my files which are used for unit testing in folder \src\test\resources

But the issue is files which are used for testing are java-files.

Despite 'mvn package' skip this files, but when opening in Idea it tries to compile them.

Is it possible to exclude this folder with java-files from sources to be compiled in Idea?

I use IntelliJ Idea 9.0.3

like image 582
sergtk Avatar asked Apr 15 '11 07:04

sergtk


People also ask

How do I ignore a folder in IntelliJ?

You can also just right click on your folder and select Mark Directory As > Excluded . Excluded folders (shown as rootExcluded) are ones that IntelliJ IDEA "partially ignores".

How exclude build in IntelliJ?

Under File > Settings > Build, Execution, Deployment > Compiler > Excludes, add an entry.

What is excluded directory IntelliJ?

In this field, the path to a file or directory to be excluded from compilation is shown. Recursively. For a directory: select this option to exclude from compilation all the corresponding subdirectories. Alt+Insert. Use this icon or shortcut to add a file or directory to the list.

How do I change the source folder in IntelliJ?

From the main menu, select File | Project Structure Ctrl+Alt+Shift+S and click Modules. Select the necessary module and open the Sources tab. next to Source Folders or Test Source Folders. Specify the package prefix and click OK.


1 Answers

Try

File -> Settings -> Compiler -> Excludes

Add your path to Path and select Recursively

like image 175
Peter Lawrey Avatar answered Sep 21 '22 23:09

Peter Lawrey