简体   繁体   中英

How do I exclude subdirectories from a project root in IntelliJ?

I am exploring a model where I codegen one .iml file per package in IntelliJ. For example, suppose I have the packages com.example.foo , com.example.foo.bar , and com.example.foo.baz . That means that in the .iml file for com.example.foo , I need:

<content url="file://$MODULE_DIR$">
  <sourceFolder url="file://$MODULE_DIR$"
                isTestSource="false"
                packagePrefix="com.example.foo" />
  <excludeFolder url="file://$MODULE_DIR$/bar" />
  <excludeFolder url="file://$MODULE_DIR$/baz" />
</content>

Every time I add a new "sub-package" of com.example.foo , I have to add a new <excludeFolder> element to <content> . Is there any way to avoid this and just say "my source directory is the immediate directory and none of the subdirectories?"

源根配置是递归的,不可能仅将目录配置为“源”,而排除其所有子目录。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM