Reading through the Apache Software License 2.0 appendix I am left unclear what exactly I have to do now:

APPENDIX: How to apply the Apache License to your work

To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.

To explain a bit more: I am currently contributing to an open-source project on github, where the decision to license under ASL2.0 was made. In the latest commit, the license text was added as LICENSE to the root directory.

The interesting part is now: What else has to be done to fully license the code under Apache Software License. In specific: What is considered "work" and is it mandatory to include the boilerplate notice to each and every source-file in the project?

I figure it should be possible to add the notice to the already existing README, as I have seen it in other open source projects. Something along the lines of:


Unless explicitly stated otherwise all files in this repository are licensed under the Apache Software License 2.0 [insert boilerplate notice here]

I think that should be okay, because the Apache Policy on Source Headers (even though intended for Apache Software Foundation owned projects only) states:

Each original source document (code and documentation, but excluding the LICENSE and NOTICE files) SHOULD include a short license header at the top. If the distribution contains documents not covered by CLA, CCLA or Software Grant (such as third-party libraries) then see the policy guide.

  1. Each source file should include the following license header -- note that there should be no copyright notice in the header:

Specifically the "should" here makes me think, that a license header in every file is not mandatory for each and every source-file of a project licensed under ASL.

  • 1
    Do you have any objections to simply including the header in each source file? – Robert Harvey Jan 14 '15 at 19:36
  • Well it's a hassle :( Additionally a possible relicensing is made unnecessarily complicated with that and I have a personal "grudge" against license headers. – Vogel612 Jan 14 '15 at 19:38
  • 2
    Meh. A license change is a Find and Replace operation across all files, in any IDE worth its salt. – Robert Harvey Jan 14 '15 at 19:42
  • You could also just include a short statement in each file such as "This project is licensed under the XYZ license. For details see the LICENSE file which can be found at the base of this project archive" or words to those effect. – Brandin Oct 6 '15 at 8:08
  • 1
    No, it is not necessary: apache.org/dev/apply-license.html#copy-per-file But as Jules states below, if a file is viewed or reused in isolation, the license will be evident – Steen Apr 6 '17 at 9:05

No, it is not necessary to include the license in every file. This is a recommended practice, because it ensures that if somebody is viewing one of the files from your project in isolation from the rest they will be able to identify the terms of use for it, but in the end, as long as you do something that makes it clear what the intended license terms are, that is enough, legally speaking.

(Note that this is not legal advice; if this is important you should seek advice of a lawyer in your jurisdiction, etc.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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