Create cleanup-policy and associate it to a repo using Groovy scripts

Hello,

I’m trying to automate my nexus instance set-up process using groovy scripts.

I have almost everything working but I wasn’t able to setup a new cleanup policy and associate it to a repo.

Any suggestion?