CDH source code is available, see https://www.cloudera.com/products/open-source/apache-hadoop/key-cdh-components.html
Please note that rebuilding the CDH jars is not a simple task and you will loose support status. I would recommend to reach out to your Cloudera Account representative instead to discuss your requirements.
got your point readring cloudera support, I am researching on possibility of CDH 5.14, jdk 8,9,10,11. From jdk 9 onwards its getting harder to compile it. CDH 6 is the only option I think.
one more thing, the links above has source code for individual components, but when compiled into package, lets say hadoop its not giving me lib64 folder which original CDH parcel has.