I faced a similar issue recently, where I had to post-process .class files before using them in run-time. There are some differences, but you might find something interesting in the discussion. I also recommend reading @st_oehme’s reply.
IMHO, having the actions as tasks (or at least as a single separate task) helps with the organization of the plugin. I’d rather have separate tasks added to the build than changing the default tasks. Also, I would avoid renaming the Jar and copying a new over it and/or changing it in place (which as enlightened by @st_oehme in comments for my initial commits, makes you lose the tasks’ up-to-date checks). I would actually create a new Jar (myJarNameEjb.jar or something like that) and use it as input for the Ear task.