Butter and line a 30 x 20cm baking tin with baking parchment, leaving an overhang so you can lift out the traybake later, then butter the parchment. Heat the oven to 180C/160C fan/gas 4.
To make the pastry, put all the ingredients, except the vanilla, into a food processor and blitz until the mixture resembles breadcrumbs. Add a couple of teaspoons of very cold water and the vanilla, then blitz again. The mixture should come together into a ball. If it doesn’t, add a little more cold water and blitz again. Press into the tin using your fingers and the back of a large spoon, then bake in the oven for 15-18 mins until pale golden. Leave to cool for 15 mins.
Stir the cardamom seeds and the lemon juice into the jam until smooth. Spread the jam over the pastry base, leaving a 2cm border all the way round. Cut each plum half into 1cm slices. Lay these in rows, overlapping, on top of the jam.
To make the crumble, put the flour, ground almonds, butter, sugar and lemon zest into a food processor (you don’t need to wash it out first), and blitz until the mixture looks like breadcrumbs. Tip this over the plums and scatter the flaked almonds on top. Bake for about 35-40 mins until the top is golden and the plums are tender. Leave to cool completely in the tin.
Carefully lift the traybake out of the tin onto your work surface using the baking parchment. Leave for a few hours so the fruit can settle. Cut into squares or rectangles, then sift some icing sugar over the top, if you like.