Prepare the water bath canner, jars, and lids. Fill the canner and set it over the heat before you start prepping, since it takes a long time to come to a boil.
Heat the oven to 375 degrees F. Brush a baking sheet with a little oil, and line a second rimmed baking sheet with foil.
Lay the eggplant quarters and red pepper halves skin side up on the oiled sheet, and brush them lightly with oil.
Set the tomato halves skin side up on the foil-lined sheet.
Roast both sheets for 25 to 30 minutes, until the skins soften and begin to char. Let the vegetables cool to room temperature on the pans.
Peel and chop the tomatoes. Scoop the eggplant flesh out of the skins, discard the skins, and chop the eggplant. Peel and chop the peppers. Keep the tomatoes separate from the eggplant and peppers, which go in later.
Put the onions, celery, garlic, and water in a large, wide pan or Dutch oven and cook over medium heat until the onions turn translucent, about 10 minutes.
Add the chopped tomatoes, olives, capers, sugar, salt, black pepper, and red wine vinegar. Simmer over medium heat, stirring often, until it thickens slightly, about 20 minutes.
Stir in the roasted eggplant and peppers and cook 5 minutes more.
Ladle the hot caponata into hot jars, leaving 1/2 inch headspace.
Remove air bubbles, check the headspace again, and wipe the rims clean.
Center the lids on the jars and apply the bands fingertip tight.
Process pints or half pints in a boiling water bath canner for 35 minutes, adjusting for altitude (see notes).
Turn off the heat, take the lid off the canner, and let the jars stand for 5 minutes before lifting them out.
Cool the jars on a towel for 12 to 24 hours, then check the seals, remove the rings, and store the jars in a cool, dark place.