To assist in our ability to step through code when debugging I'd like to recommend our JAR files be built to include source code. I'm wondering what issues that might cause. My immediate thought was that the JAR files would be slightly larger. I can live with that. Are there other issues I need to consider?
TIA
Normally you separate compiled code and source code into two different jars.
Then you can attach the source-code jar in your IDE when you need to debug the code.
A build tool like maven will easily do that for you.
I highly recommend it. I do this and so do some open source projects (e.g. jMock, Hamcrest, GWT).
It saves fussing about with separate source jars. It also means that if at some point in the future the source project is lost (as sometimes happens in large organizations) the maintenance programmers down the line will have a fighting chance of recreating it.
If you're happy that those people with access to the jar can see your source code and are prepared to pay the penalty of an increase in jar size (and a probably negligible increase in the time to create, transfer and deploy the jar) then that's all you need to worry about. There aren't any other issues as far as I am aware.
Just because the Maven standard is to keep source files separate doesn't mean you have to do it that way.
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