3

When I build a .jar artifact using IntelliJ, it adds an empty folder/package named 'generated' to my jar file. Why is that?

My artifact 'Output Layout':

name.jar
-  file.yml
- '%module name%' compile output

enter image description here

Foreign
  • 385
  • 2
  • 20
  • How is your project artifact configured? Sample project from https://stackoverflow.com/a/42200519/104891 doesn't do it, so it must be specific to your project and the only way to tell why it happens is by checking the [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – CrazyCoder Feb 09 '19 at 01:13
  • Actually, I just realized that every module has a "generated" folder inside out/production// and I'm adding the 'compile output' to the artifact, which includes the "generated" folder. I just created a new module, with stock IntelliJ settings and with a simple hello world class to test it, and it also creates this folder. – Foreign Feb 09 '19 at 18:31
  • Do you use Maven or Gradle based project? – CrazyCoder Feb 09 '19 at 19:33
  • For this specific test, neither. It's a "simple" java module. File > New > Module > Java. – Foreign Feb 09 '19 at 20:16

1 Answers1

1

generated directory appears in the output if you have annotation processing enabled in IntelliJ IDEA compiler settings.

You can disable this option, delete the generated directory and rebuild the project and the artifact to make it go away, but it should not affect your application in any way, so you can just ignore it.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • Thanks. I know it doesn't affect anything, is just something I have noticed (I'm moving from Eclipse) and started to wonder what it was about. – Foreign Feb 09 '19 at 20:26