Avoid ports doubled used

Hallo,
ist there a way to avoid doubled configured ports while using tools like jenkins to import ans start stacks?
Or if not is there away to list all ports in use?
Ralf