def package_maven():
if not os.getenv('<STR_LIT>'):<EOL><INDENT>os.environ['<STR_LIT>'] = jdk_home_dir<EOL><DEDENT>mvn_goal = '<STR_LIT>'<EOL>log.info("<STR_LIT>" + mvn_goal + "<STR_LIT:'>")<EOL>code = subprocess.call(['<STR_LIT>', '<STR_LIT>', mvn_goal, '<STR_LIT>'],<EOL>shell=platform.system() == '<STR_LIT>')<EOL>if code:<EOL><INDENT>exit(code)<EOL><DEDENT>if not os.path.exists(lib_dir):<EOL><INDENT>os.mkdir(lib_dir)<EOL><DEDENT>target_dir = os.path.join(base_dir, '<STR_LIT:target>')<EOL>jar_files = glob.glob(os.path.join(target_dir, '<STR_LIT>'))<EOL>jar_files = [f for f in jar_files<EOL>if not (f.endswith('<STR_LIT>')<EOL>or f.endswith('<STR_LIT>'))]<EOL>if not jar_files:<EOL><INDENT>log.error('<STR_LIT>')<EOL>exit(<NUM_LIT:1>)<EOL><DEDENT>for jar_file in jar_files:<EOL><INDENT>build_dir = _build_dir()<EOL>log.info("<STR_LIT>" + jar_file + "<STR_LIT>" + build_dir + "<STR_LIT>")<EOL>shutil.copy(jar_file, build_dir)<EOL><DEDENT>
Run maven package lifecycle