开发者

Adding license to new files when using Eclipse and the Copyright wizard plugin

I've just installed this Copyright wizard plugin for managing copyright disclaimers in my Eclipse projects. I discovered it thanks to this post.

I set it up and all works fine:

  1. I created my own copyright header
  2. 开发者_如何转开发
  3. 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, the copyright isn't added by default. How can I solve this?


It sounds like you're looking for Eclipse's Code Templates feature. In the version of Eclipse I have handy, it's found through Preferences -> Java -> Code Style -> Code Templates.

I have a feeling that you will be most interested in either the New Java files (found under Code) or Files (found under Comments) template.

There is corresponding functionality for XML files under Preferences -> XML -> XML Files -> Editor -> Templates (look at the xml declaration template), and for Ant files under Preferences -> Ant -> Editor -> Templates (Buildfile template). I am willing to bet that there are similar templates for pretty much every other language Eclipse can be used with.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜