Search code examples
javaintellij-ideacxf

Change,modify and repackage CXF-API source file


I want to debug one of the class from cxf-api-2.7.6 jar file ,downloaded the source file with the help of IntelliJ IDEA,but it does not contain POM file so what are the exact steps to generate the jar file after making changes in the source file.

Any help or suggestion would be greatly appreciated.

Thanks!


Solution

  • You should not modify a library and recompile it. It will be a pain to maintain. You will probably never be able to upgrade your library, and you might break some other behaviors.

    If you just need to understand what is happening, you can use intellij debug tools as mentionned by Pim Hazebroek.

    If you need to change the behavior of the library, you should :

    • Check that you are not misusing the library (you could post your usecase on stackoverflow for advice)
    • Check whether the latest version of cxf addresses your needs.
    • Use a different library.
    • Extend your current library (with inheritance for instance)

    If however, you really need to modify cxf sources, you could clone https://github.com/apache/cxf, checkout the tag, modify the sources and rebuild.