Sterilise your jars following the instructions in this blog post.
Thinly shred your ginger and slice the garlic and onions before adding to a shallow casserole dish or large saucepan.
Peel, core and chop the apples and add to the pan with all the spices, vinegar, and salt.
Bring the pan to the boil over a medium heat, stir, replace the lid and turn down the heat. Simmer for 30 minutes.
Stone and quarter the plums and add to your pan, mixing well with the cooked apples. Stir in the sugar and leave to simmer uncovered for another 30 minutes. Stir regularly until the plums are cooked.
Remove the cinnamon stick and star anise before decanting into the jars you sterilised earlier.
If kept unopened in a cool place this will last for up to a year, but once opened keep in the fridge and use within a month.