I read on various sites about licenses.

I did just put the license type in the header file (in my case a javascript file, open-source):

 * "codeName" "version"
 * http://officialsite.com/
 * Copyright 2012 "codeName"
 * Released under the "LICENSE NAME" license
 * http://officialsite.com/LICENSE NAME

 javascript code

In the same folder I leave a copy of the license. The listing of the folder looks like this:

* codeName.js

In the file LICENSE is the full text of the license my code uses.

What I cannot find anywhere that says is this is enough to say my code is licensed (the case of open-source). Is something more required?


Major open source licenses like the Apache or GPL have instructions on exactly how to put a comment at the top of each one of your source files. If you follow those instructions, you should be good. And yes, generally that means choosing a license, and adding a header as you showed at the top of every one of your source files. Please try to pick a license you will want to keep (understand the difference between Apache and GPL) and license all the files for your project under the same license.

The other thing you might want is a contributor's agreement. Contributors sign it to state that they are not adding any copyrighted, patented, or trademarked contributions to your code, or that if anything is copyrightable, patentable, or trademarkable, it falls under the license for the project. Consider a clause that states your intent in licensing and allows you to change the license to another one with the same intent at any time, or if the current license is proven difficult to enforce in court.

That said, I generally don't see licenses in HTML, CSS, or JavaScript files that get sent to the client. I think it's reasonable if you want to consider an abbreviated version for those files to speed up download times.

I am not a lawyer. These are just observations and suggestions, not legal advice.

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.