<p>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 refers to the license or contains the license itself.</p>

<p>Since adding these banners to each file manually seems to be a daunting and error-prone task. How can I go about automating the insertion of these banners?</p>

<p><strong><em>Edit:</em></strong> I've eventually found <a href="https://marketplace.eclipse.org/content/copyright-wizard" rel="nofollow noreferrer">Copyright Wizard</a> and <a href="https://marketplace.eclipse.org/content/eclipse-copyright-generator" rel="nofollow noreferrer">Copyright Generator</a> which are Eclipse plug-ins which also allow for updating existing license banners.</p>

Concerning best practises, I believe you should have your license text in a separate file and have a build tool (ie ant) to add it at the beginning of all other files. Since you are talking about an open source project you would need a build process anyway for thinks like generating the javadocs, publishing releases etc.
BTW,ant tasks are simple Java classes so it should be easy to write one yourself  if you don't find an ant plugin that does exactly that.
Coming to eclipse, to my knowledge, it cannot do something like this. The quickest way I can think of to do it is with bash (if you are using Linux). Assume the file msg contains the text you want to add at the beginning of every file.
Create a new directory to store the files:
mkdir ~/outdir
Add the msg at the beginning of every file and put the result at the outdir
for i in
```
ls "*.java"
```
; do cat msg $i > ~/outdir/$i ; done
Similarly you can write a command that does the same recursively, with an extra step to create the directory strucutre:
```
```
mkdir ~/outdir
for i in `find -type d | sed 's/\.//' | grep -v "^$"`; do mkdir ~/outdir$i; done
for i in `find -name "*.java"`; do cat msg $i > ~/outdir/$i ; done
```
```