Keep in mind that there is a big difference between a battery charger and a maintenance charger. A good maintenance charger will only charge the battery when it drops below a threshold and just monitor it the rest of the time. Really good maintenance chargers will test and desulfate the battery when needed as well. Optimate III is my favorite and has been since around '05 when I got my first one for the '04 FJR. They often sell them cheaper as Honda branded units, so it pays to look around if you're in the market. I got 9 years from my original Yuasa battery on the FJR and it was still good when I sold it. It desulfated three times, the first time I hooked up the battery after two years of use, about 5 years later and a month or so before I sold the bike.
If you're really not going to be riding a bike for potentially years, it's probably a good idea to pull the plugs and squirt a little engine oil in the plug holes, reinstall the plugs, top off the fuel with some Stabil and just leave it alone. On the center stand if possible to take weight off the tires to a degree, and remove the battery and store it in a location not on concrete that is temperature controlled, ideally on a maintenance charger.
If you're really not going to be riding a bike for potentially years, it's probably a good idea to pull the plugs and squirt a little engine oil in the plug holes, reinstall the plugs, top off the fuel with some Stabil and just leave it alone. On the center stand if possible to take weight off the tires to a degree, and remove the battery and store it in a location not on concrete that is temperature controlled, ideally on a maintenance charger.