I'm working on Open Source Java library. I don't want to waste time writing classes that Spring framework already has. I want to copy single files from Spring Framework and refactor it to cut dependencies from whole Spring and connect it with my library.

  1. What should I do with copyright information at the beginning of each copied file and comments about authors? Because this files will be refactored, information about authors will be obsolete in future.

  2. Should I put information about borrowing files from Spring Framework and original authors in the main LICENSE.txt file?

1 Answer 1


When copying a file from another project, you must always keep the copyright and license statements intact. At the most, you could change a phrase like "this file is part of project X" into something like "this file was copied from project X and is now part of project Y" and if the copyright statement does not list the names of people, make it clear that the reference is related to project X.
If you make (non-trivial) changes to a copied file, then you could add your name to the copyright statement.

If your code is not distributed under the same license as the Spring Framework, then you must make it clear (this could be in the main LICENSE.txt file) which parts of the code are under which license. There is no need to refer to the original authors here, as that information should be kept in the source files themselves, if it was mentioned there initially.

  • What if I'm mixing open source code with my open source code in a file? Do I have to put a disclaimer before the copied code every time or what? Do I put in the LICENSE.txt "lines 122-136 and 650-750 are from <other project>"
    – user14263
    Mar 29, 2022 at 2:13
  • @Boris, you don't have to indicate exactly which parts you copied from the other project, only that you copied some code from them. Mar 29, 2022 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.