const path = require('path'); module.exports = { tags: async (tln) => [], options: async (tln) => [], env: async (tln, env) => { env.MAVEN_HOME = env.TLN_COMPONENT_HOME; env.M2_HOME = env.TLN_COMPONENT_HOME; env.PATH = [path.join(env.TLN_COMPONENT_HOME, 'bin'), env.PATH].join(path.delimiter); }, dotenvs: async (tln) => [], inherits: async (tln) => [], depends: async (tln) => [], steps: async (tln) => [ { id: 'version', builder: async (tln, script) => { const id = script.env.TLN_COMPONENT_ID; const home = script.env.TLN_COMPONENT_HOME; const {name, version} = tln.unpackId(id); if (version) { script.set([` echo [maven] && mvn -v `]); } }}, { id: 'install', filter: '', builder: async (tln, script) => { const id = script.env.TLN_COMPONENT_ID; const home = script.env.TLN_COMPONENT_HOME; const {name, version} = tln.unpackId(id); if (version) { if (tln.canInstallComponent(tln, id, home)) { const desc = { name: `apache-maven-${version}-bin.zip`, opts: { src: `apache-maven-${version}`, flt: '*', dest: '.', rmv: `apache-maven-${version}` }, url: `https://archive.apache.org/dist/maven/maven-3/${version}/binaries/apache-maven-${version}-bin.zip` } script.set(tln.getDownloadScript(tln, { linux: desc, darwin: desc, win32: desc })); } } else { /* script.set(tln.selectScript(tln, { linux: ['sudo apt install maven -y'], darwin: [], win32: [] })); */ } } } ], components: async (tln) => require('./components.js') }