Exclude compile output files in intellij jar artifact


I am using intellij version 14. I want to exclude some files from the compile output before creating the jar artifact. I cannot mark them as excluded from the module sources since my code is accessing them using getClassLoader().getResource(). I don't want these files in the jar because they are huge in size and I would never be executing the jar such that the code that accesses these files runs.

What are some of the options to generate the jar output as an artifact from intellij by excluding these files?

Note - I understand that we could add pre-processing and post processing ant targets that could possibly help out here but what should I add in the ant target - delete the files from the compiled output folder as a pre-processing step?

Kindly let me know your thoughts. Thanks !

1 comment
Comment actions Permalink

Please vote for https://youtrack.jetbrains.com/issue/IDEA-153998.

I'd delete the files from the jar in post-processing, otherwise IDE output folder will be affected by the external change and IDE Make process will perform a rebuild next time.


Please sign in to leave a comment.