Place the olive oil in a medium skillet over medium heat. Add in the onions and cook for 30 minutes, stirring occasionally or until the onions are caramelized. Add the garlic and cook for 2 minutes. Remove from heat.
Add the yeast and warm water to a large bowl. Give it a quick stir then allow it to sit and foam for 5 minutes.
Add in the milk, sugar, olive oil, black pepper, salt, caramelized onions, and 4 cups of the flour. Mix until a dough forms.
Add in additional flour as needed until the dough is no longer sticky.
Turn dough onto a floured surface and knead for 5 minutes.
Spray a large bowl with cooking spray and put the ball of dough in the bowl, turning once to coat with spray.
Cover the bowl with a tea towel and put in a warm area for 1 hour.
After an hour the dough should double in size. Punch down the dough and divide it in half. Make each half into a 16 x 6 rectangle (or something close to that).
Sprinkle half the cheese and rosemary on each dough rectangle, leaving a 1/2 inch seam on all sides. Roll the dough tightly like a jellyroll so that it resembles a long rope. Pinch the ends and sides to seal the cheese inside. Cut each dough roll in half and pinch the centers closed.
Take two dough rolls and braid them together. It will be a loose braid.
Spray two bread pans with cooking spray and set one braid in each pan. Cover and let rise for 1 hour.
Preheat the oven to 350 degrees.
Bake the bread for 50-55 minutes or until golden brown. Remove from the oven and cool for 5 minutes. Then run a knife around the edges, and remove from pan.
Cool completely on a wire rack.