Preheat the oven to 190C /375F/ GM5.
Cook the pasta in a large pan of boiling water for 1-2 minutes less than recommended on the pack it should be al-dente (firm but with a little bite left). Drain and set aside
While the pasta is cooking, finely dice the shallot and mince the garlic.
Deseed and chop the pepper into pieces approx 1 cm square.
Take half of the aubergine and chop into chunks around 1 cm cubed.
Mince the remaining aubergine and the mushrooms in a food processor (chop roughly before adding).
Fry the shallot in a little oil for 2-3 minutes until beginning to soften. Add the minced garlic, fry for another minute.
Add the minced aubergine and mushrooms. Fry, stirring occasionally for 5 minutes.
Add the pepper and aubergine chunks and fry for a further 5 minutes, stirring frequently.
Add 150 ml of stock to the pan along with the tinned tomatoes, herbs, chilli flakes, salt, pepper and tomato puree. Stir and let cook gently for 15-20 minutes, adding more stock if the sauce looks to be drying out or getting too thick. Cook a little longer to thicken the sauce more if necessary.
Once the vegetables are tender and the sauce looks thick enough to coat the pasta nicely, stir through the pesto, pine nuts and black olives.
Next, add the pasta, mix thoroughly and transfer to an ovenproof baking dish approximately 12-inches (30cm) in diameter and 3-inches (8cm) deep.
Tear the mozzarella into pieces and dot it over the top of the pasta.
Cover with a lid (or foil) and bake for 20 minutes, then uncover and bake for a further 10 minutes until the cheese turns golden in places.
Take out of the oven and top with fresh herbs (e.g. rosemary, thyme or parsley) before serving