We generalize basic results relating the associated graded Lie algebra and the holonomy Lie algebra of a group, from finitely presented, commutator-relators groups to arbitrary finitely presented groups. Using the notion of "echelon presentation," we give an explicit formula for the cupproduct in the cohomology of a finite 2-complex. This yields an algorithm for computing the corresponding holonomy Lie algebra, based on a Magnus expansion method. As an application, we discuss issues of graded-formality, filtered-formality, 1-formality, and mildness. We illustrate our approach with examples drawn from a variety of group-theoretic and topological contexts, such as link groups, one-relator groups, and fundamental groups of orientable Seifert fibered manifolds.