How to manage license banners in source files of Eclipse projects

后端 未结 2 503
说谎
说谎 2020-12-16 13:14

I\'m about to release a set of Eclipse plug-ins as Open Source and noticed that most source code released under the LGPL/EPL contains a header banner in each file that refer

2条回答
  •  天命终不由人
    2020-12-16 13:44

    A more Eclipse-like approach than the manual addition is the following, done via GUI in Eclipse. Note that these are the Linux / Windows menus; Mac is a bit different.

    1. Open Windows->Preferences
    2. Navigate to Java->Code Style->Code Templates
    3. Edit the Comments->Files comment template to include your boilerplate.
      There are variables for the current year, file name, etc...

    Note, also, that this is a solution for new files only; it's not going to help you with old files; for that, I would use something like idrosid's solution for your existing code

提交回复
热议问题