Java‎ > ‎


I found a tool that will  apply copyright information to existing java code in batch mode.

Here are the instructions:

  1. Follow instructions at this link - to install the plugin to eclipse. NOTE: to get the CVS respositories view, open the “CVS Repository Exploring” perspective – Window -> Open Perspective -> Other -> CVS Repository Exploring. Also the version I chose for the plugin was 3.4, since I use eclipse 3.4.
  2. After step 1, the plugin gets exported to a directory called plugins under the Eclipse plugins folder. So, move the jar file up one level into the Eclipse plugins folder. Then restart eclipse.
  3. After you restart, go to Windows -> Preferences -> Copyright Tool and add the copyright information attached into the Copyright template field. Make sure Default Creation year and Default revision year are entered correctly. I used 2010. Click Apply and OK.
  4. Make sure you open the Navigator view in Eclipse – Window -> Show View ->Navigator
  5. Assuming you have the Perforce plug-in setup, right click the maven project or module that you want copyright information for and Select Team -> Open for Edit. This checks out all the files.
  6. Right Click the project or module again and select Advanced Fix Copyrights. This adds copyright information to all the checked out files of the module or project.
  7. Right click the module or project and select Team ->Submit to check in the files

 For new files, you can use the Eclipse formatter so it adds copyrights or other comments when you create the file.