Adding a license for new files using Eclipse and the Wizard plugin

I just installed this copyright protection plugin to manage copyright disclaimers in my Eclipse projects. I discovered this thanks to the post.

I configured it and everything works fine:

  • I created my own copyright protection header.
  • I used the wizard to apply it to all files of an existing project

Now I have the following problem:

When I create a new file inside the project, copyright is not added by default. How can i solve this?

+6
source share
1 answer

It looks like you are looking for Eclipse Code Templates . In the Eclipse version I have the convenience, it is found using Preferences β†’ Java β†’ Code Style β†’ Code Templates.

I have the feeling that you are most interested in either the New Java files template (found under the code) or Files (found in the comments).

There is a corresponding functionality for XML files in the Settings section β†’ XML β†’ XML files β†’ Editor β†’ Templates (see the xml declaration template) and for Ant files in the Settings section β†’ Ant β†’ Editor β†’ Buildfile template . I bet that there are similar patterns for almost any other language with which you can use Eclipse.

+4
source

Source: https://habr.com/ru/post/896559/


All Articles