/** * Get version of artifact. If artifact doesn't have version this method checks parent artifact * for version. */ public static String getVersion(Model model) { String version = model.getVersion(); if (version == null) { final Parent parent = model.getParent(); if (parent != null) { version = parent.getVersion(); } } return version; }
/** * Get groupId of artifact. If artifact doesn't have groupId this method checks parent artifact * for groupId. */ public static String getGroupId(Model model) { String groupId = model.getGroupId(); if (groupId == null) { final Parent parent = model.getParent(); if (parent != null) { groupId = parent.getGroupId(); } } return groupId; }