Adding and Using WSO2 Copyright License in VSCode

Photo by NICHOLAS BYRNE on Unsplash

WSO2 is one of the prominent companies, that provides free open-source software that can be used and improved by anyone worldwide. Hence, it is possible for anyone to contribute to the development of WSO2 projects and become a part of the WSO2 community.

Since we are open source, having a Copyright License is crucial since it describes a project file’s permitted usage and ownership. From this article, let’s look at how to add a license header from VSCode.

Let’s add the license profile 😊

  1. First, create or open an existing project in VSCode.
  2. Install the File Header Comment extension in VSCode. This extension will aid us to manage license headers in the IDE easily.
  3. Press shift+command+p (in Windows shift+control+p) and type open user settings (JSON).

4. In the JSON file, replace fileHeaderComment.parameter variable with the following,

“fileHeaderComment.parameter”:{  “*”:{    “author”: “Your Name”,    “license_wso2”:[      “Copyright © ${year} WSO2 LLC. (",      “”,      “ WSO2 LLC. licenses this file to you under the Apache License,”,      “ Version 2.0 (the \”License\”); you may not use this file except”,      “ in compliance with the License.”,      “ You may obtain a copy of the License at”,      “”,      “",      “”,      “ Unless required by applicable law or agreed to in writing,”,      “ software distributed under the License is distributed on an”,      “ \”AS IS\” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY”,      “ KIND, either express or implied. See the License for the”,      “ specific language governing permissions and limitations”,      “ under the License.”    ]  }},“fileHeaderComment.template”:{  “wso2”:[    “${commentbegin}”,    “${commentprefix} ${license_wso2}”,    “${commentend}”  ]},

Finally the settings.json file should look like this.

5. Also, don’t forget to save the file 😉.

Let’s add the license header 🤗

We have successfully added the license profile, now let’s add the license to the new file or an existing file.

  1. Press shift+command+p (in Windows shift+control+p) and type FileHeaderComment: Select from Available Templates.
  2. Select wso2.

And THAT’S IT 🥳. See, it is not that difficult 😄.

Also if you want to know about adding license headers to WSO2 projects from IntelliJ you can follow this article as well 😊👇.

Conclusion ✌

This is the end of the article. Before I finish, I want to say, if I have made any mistakes or if there is an easy way to do this please add a comment below. If you find this article useful, feel free to share this with your friends and colleagues.

Thank you and HAPPY CODING! 👋🧑‍💻👩‍💻



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store