I want to exclude individual .java
files from a Content Root in IntelliJ. The documentation on "Excluding Files from Project" suggests that this is not possible (it explicitly says This action is not applicable to Java files and binaries.)
Being incredulous to such a limitation, I have tried editing my .iml
file, optimistically inserting XML elements such as <excludeFile>
under the <content>
element, but nothing seems to take.
Does anyone know a way to do this (documented or otherwise)? Or have any clue why this feature is not supported? By comparison, Eclipse allows for an arbitrary including
pattern for a <classpathentry>
element in its .classpath
file.
A module file (the . iml file) is used for keeping module configuration. Modules allow you to combine several technologies and frameworks in one application. In IntelliJ IDEA, you can create several modules for a project and each of them can be responsible for its own framework.
You can exclude files from compilation and classpath. As far as I understand it will have the same effect as manipulating with <classpathentry>
in Eclipse.
To exclude files/folders by pattern and globally use Ignore files and folders option in the File Types dialog. This way the files will be completely ignored and not visible in the Project View, but it's probably not what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With