diff --git a/mulint.js b/mulint.js index 47b9fcb..ce46d42 100755 --- a/mulint.js +++ b/mulint.js @@ -14,9 +14,10 @@ const validateLog4j = require("./validateLog4j"); const assert = require("./assert"); program - .version("2.0.1") + .version("3.0.0") .description("Mule project linter") .arguments("") + .option("-d, --detect-deploy", "Detect deployment type (otherwise assumes on-prem)") .on("--help", () => { const path = "C:\\SourceCode\\mulesoft-apis\\System APIs\\wsflx-system-api"; console.log(""); @@ -30,7 +31,8 @@ program apiBasePath = apiBasePath.replace(/"$/, ""); let folderInfo = folderParser(apiBasePath); - let pomInfo = pomParser(folderInfo.pomFile); + let pomInfo = pomParser(folderInfo.pomFile, program.detectDeploy); + validateApiFiles(folderInfo, pomInfo); validatePom(folderInfo, pomInfo); validateGlobal(folderInfo); diff --git a/pomParser.js b/pomParser.js index bcb0d43..6887893 100644 --- a/pomParser.js +++ b/pomParser.js @@ -1,6 +1,6 @@ const xmlParser = require("./xmlParser"); -const pomParser = pomFile => { +const pomParser = (pomFile, detectDeploy) => { let { xml } = xmlParser(pomFile); let xmlProperties = xml.project.properties[0]; let properties = new Map(); @@ -23,9 +23,15 @@ const pomParser = pomFile => { let muleMavenPlugin = findPlugin("mule-maven-plugin"); - // Currently assuming if not using the Mule Maven Plugin then deploying on-prem. - let isOnPrem = - !muleMavenPlugin || properties.get("deployment.type") === "arm"; + let isOnPrem; + + if (detectDeploy) { + // Currently assuming if not using the Mule Maven Plugin then deploying on-prem. + isOnPrem = + !muleMavenPlugin || properties.get("deployment.type") === "arm"; + } else { + isOnPrem = true; + } return { findDependency,