Bit-Man
Bit-Man

Reputation: 546

mvn idea:idea exclude folder wildcard?

Running mvn idea:idea to generate IntelliJ IDEA project files we stumble into a folder that must be avoided, let's say .avoidMe, which is located inside every folder as a placeholder.

folder1 
   |
   +- .avoidMe
   |
   +- folder2
   |     |
   |     +- .avoidMe
   |
   +- folder3
   |     |
   |     +- .avoidMe
 . . .

I've looked at idea:idea exclude options but none of them accepts wildcars (e.g. .avoidMe , "/.avoidMe/" or else ) so that I need to add every possible path to the exclude property ( e.g. folder1/.avoidMe,folder1/folder2/.avoidMe,folder1/folder3/.avoidMe )

The idea here is to use it to run IDEA inspections and publish the results into Sonar.

Upvotes: 1

Views: 438

Answers (1)

CrazyCoder
CrazyCoder

Reputation: 402423

You should never use mvn idea:idea, it's obsolete and was not updated for years. It's also known to generate incorrect projects with the bugs that will be hard to trace later.

Instead, just import pom.xml in IDEA, project files will be generated by IDEA automatically. You can then Exclude certain folders in Project Structure | Modules | Sources. Be aware that this configuration will be lost on the next reimport.

There is another configuration to exclude folders that is global and will be not lost on reimport: Settings | File Types | Ignore files and folders.

Upvotes: 1

Related Questions