def no_cls(): return '%s/service/local/artifact/maven/redirect?r=%s&g=%s&a=%s&v=%s&e=%s' % \ (c.getenv_or_exit('NEXUS'), c.getenv_or_exit('REPO'), c.getenv_or_exit('GID'), art['a'], art['v'], art['e'])
def artifact_name_breakdown(name): ls = re.split(version_splitter(), name) return dict(zip(['a', 'v', 'c', 'e'], [c.getenv_or_exit('AID'), c.get_or_none(ls, 1), c.get_or_none(ls[2].split('.'), 0)[1:], '.'.join(ls[2].split('.')[1:])]))
def get_artifacts(): arts = map(lambda x: x.text, ET.fromstring(c.get_url( format_version_nexus_url( check_version( reduce_to_mcv_2())))).findall('data/*/text')) lv = sorted( filter(lambda x: x is not None, list(set(map( lambda x: c.get_or_none(re.split(version_splitter(), x), 1), arts)))), key=lambda x: x.split('-')[-1]) if get_behavior() == 'E': iv = c.getenv_or_exit('VERSION') return filter(lambda x: iv in x, arts) if iv in lv else \ c.print_and_exit(c.write_log('No such version', 'e'), 3) else: return filter(lambda x: lv[-1] in x, arts)
def exact_to_snapshot(v): return re.split(r'(\d+.\d+.\d+-\d+.\d+-\d+)', c.getenv_or_exit('VERSION'))[0] + '-SNAPSHOT'