Jennifer Lopez and Ben Affleck have officially settled the terms of their divorce, bringing an end to their brief two-year marriage.