Code review comment: ```suggestion                                        "you are trying to build/compile a module giving the absolute path. You " + ```

Code under review:
public void execute() {
        if (this.helpFlag) {
            String commandUsageInfo = BLauncherCmd.getCommandUsageInfo(BUILD_COMMAND);
            this.errStream.println(commandUsageInfo);
            return;
        }

        String[] args = LaunchUtils
                .initConfigurations(this.argList == null ? new String[0] : this.argList.toArray(new String[0]));

        
        if (args.length > 1) {
            CommandUtil.printError(this.errStream, "too many arguments.", buildCmd, false);
            CommandUtil.exitError(this.exitWhenFinish);
            return;
        }
    
        
        if (!this.buildAll && (this.argList == null || this.argList.size() == 0)) {
            CommandUtil.printError(this.errStream,
                    "'build' command requires a module name or a Ballerina file to build/compile. Use '-a' or " +
                    "'--all' to build/compile all the modules of the project.",
                    "ballerina build {<ballerina-file> | <module-name> | -a | --all}",
                    false);
            CommandUtil.exitError(this.exitWhenFinish);
            return;
        }
        
        
        this.sourceRootPath = null != this.sourceRoot ?
                Paths.get(this.sourceRoot).toAbsolutePath() : this.sourceRootPath;
        Path sourcePath = null;
        Path targetPath;
        
        
        
        if (this.buildAll) {
            
            
            if (null != this.output) {
                CommandUtil.printError(this.errStream,
                                       "'-o' and '--output' are only supported for building a single Ballerina " +
                                               "file.",
                                       "ballerina build -o <output-file> <ballerina-file> ",
                                       true);
                CommandUtil.exitError(this.exitWhenFinish);
                return;
            }
        
            
            if (!ProjectDirs.isProject(this.sourceRootPath)) {
                Path findRoot = ProjectDirs.findProjectRoot(this.sourceRootPath);
                if (null == findRoot) {
                    CommandUtil.printError(this.errStream,
                                           "you are trying to build/compile a Ballerina project that does not have a " +
                                                   "Ballerina.toml file.",
                                           null,
                                           false);
                    CommandUtil.exitError(this.exitWhenFinish);
                    return;
                }
                
                this.sourceRootPath = findRoot;
            }
        
            targetPath = this.sourceRootPath.resolve(ProjectDirConstants.TARGET_DIR_NAME);

            if (args.length > 0) {
                CommandUtil.printError(this.errStream, "too many arguments.", buildCmd, false);
                CommandUtil.exitError(this.exitWhenFinish);
                return;
            }
        } else if (this.argList.get(0).endsWith(BLangConstants.BLANG_SRC_FILE_SUFFIX)) {
            
            if (this.compile) {
                CommandUtil.printError(this.errStream,
                                       "'-c' or '--compile' can only be used with modules.", null, false);
                CommandUtil.exitError(this.exitWhenFinish);
                return;
            } else {
                
                if (Paths.get(this.argList.get(0)).isAbsolute()) {
                    sourcePath = Paths.get(this.argList.get(0));
                    this.sourceRootPath = sourcePath.getParent();
                } else {
                    sourcePath = this.sourceRootPath.resolve(this.argList.get(0));
                }
                
                
                if (Files.notExists(sourcePath)) {
                    CommandUtil.printError(this.errStream,
                                           "'" + sourcePath + "' Ballerina file does not exist.",
                                           null,
                                           false);
                    CommandUtil.exitError(this.exitWhenFinish);
                    return;
                }
                
                
                if (!Files.isRegularFile(sourcePath)) {
                    CommandUtil.printError(this.errStream,
                                           "'" + sourcePath +
                                                   "' is not a Ballerina file. Check if it is a symlink or a shortcut.",
                                           null,
                                           false);
                    CommandUtil.exitError(this.exitWhenFinish);
                    return;
                }
                
                try {
                    targetPath = Files.createTempDirectory("ballerina-build-" + System.nanoTime());
                } catch (IOException e) {
                    throw LauncherUtils.createLauncherException("Error occurred when creating executable.");
                }
            }
        } else if (Files.exists(
                this.sourceRootPath.resolve(ProjectDirConstants.SOURCE_DIR_NAME).resolve(this.argList.get(0))) &&
                Files.isDirectory(
                        this.sourceRootPath.resolve(ProjectDirConstants.SOURCE_DIR_NAME)
                                .resolve(this.argList.get(0)))) {

            
            
            if (null != this.output) {
                CommandUtil.printError(this.errStream,
                                       "'-o' and '--output' are only supported for building a single Ballerina " +
                                               "file.",
                                       null,
                                       false);
                CommandUtil.exitError(this.exitWhenFinish);
                return;
            }
            
            
            if (!RepoUtils.isBallerinaProject(this.sourceRootPath)) {
                CommandUtil.printError(this.errStream,
                        "you are trying to build/compile a module that is not inside a project.",
                        null,
                        false);
                CommandUtil.exitError(this.exitWhenFinish);
                return;
            }
            
            
            if (Paths.get(argList.get(0)).isAbsolute()) {
                CommandUtil.printError(this.errStream,
                                       "you are trying to build/compile a module by giving the absolute path. You " +
                                               "only need to give the name of the module.",
                                       "ballerina build [-c] <module-name>",
                                       true);
                CommandUtil.exitError(this.exitWhenFinish);
                return;
            }
    
            String moduleName = argList.get(0);
    
            
            if (moduleName.endsWith("/")) {
                moduleName = moduleName.substring(0, moduleName.length() - 1);
            }
            
            sourcePath = Paths.get(moduleName);
            
            
            if (Files.notExists(this.sourceRootPath.resolve(ProjectDirConstants.SOURCE_DIR_NAME).resolve(sourcePath))) {
                CommandUtil.printError(this.errStream,
                        "'" + sourcePath + "' module does not exist.",
                        "ballerina build [-c] <module-name>",
                        true);
                CommandUtil.exitError(this.exitWhenFinish);
                return;
            }
    
            targetPath = this.sourceRootPath.resolve(ProjectDirConstants.TARGET_DIR_NAME);
        } else {
            CommandUtil.printError(this.errStream,
                                   "invalid Ballerina source path. It should either be a name of a module in a " +
                                   "Ballerina project or a file with a \'" + BLangConstants.BLANG_SRC_FILE_SUFFIX +
                                   "\' extension. Use -a or --all " +
                                   "to build or compile all modules.",
                                   "ballerina build {<ballerina-file> | <module-name> | -a | --all}",
                                   true);
            CommandUtil.exitError(this.exitWhenFinish);
            return;
        }
        
        
        this.sourceRootPath = this.sourceRootPath.normalize();
        sourcePath = sourcePath == null ? null : sourcePath.normalize();
        targetPath = targetPath.normalize();
        
        
        CompilerContext compilerContext = new CompilerContext();
        CompilerOptions options = CompilerOptions.getInstance(compilerContext);
        options.put(PROJECT_DIR, this.sourceRootPath.toString());
        options.put(OFFLINE, Boolean.toString(this.offline));
        options.put(COMPILER_PHASE, CompilerPhase.BIR_GEN.toString());
        options.put(LOCK_ENABLED, Boolean.toString(!this.skipLock));
        options.put(SKIP_TESTS, Boolean.toString(this.skipTests));
        options.put(TEST_ENABLED, "true");
        options.put(EXPERIMENTAL_FEATURES_ENABLED, Boolean.toString(this.experimentalFlag));
        options.put(PRESERVE_WHITESPACE, "true");
        
        BuildContext buildContext = new BuildContext(this.sourceRootPath, targetPath, sourcePath, compilerContext);
        buildContext.setOut(outStream);
        buildContext.setErr(errStream);
    
        boolean isSingleFileBuild = buildContext.getSourceType().equals(SINGLE_BAL_FILE);
        
        Path outputPath = null == this.output ? Paths.get(System.getProperty("user.dir")) : Paths.get(this.output);

        TaskExecutor taskExecutor = new TaskExecutor.TaskBuilder()
                .addTask(new CleanTargetDirTask(), isSingleFileBuild)   
                .addTask(new CreateTargetDirTask()) 
                .addTask(new CompileTask()) 
                .addTask(new CreateLockFileTask(), this.skipLock || isSingleFileBuild)  
                                                                    
                .addTask(new CreateBaloTask(), isSingleFileBuild)   
                .addTask(new CreateBirTask())   
                .addTask(new CopyNativeLibTask(skipCopyLibsFromDist))    
                
                .addTask(new CreateJarTask(this.dumpBIR, skipCopyLibsFromDist, this.nativeBinary, this.dumpLLVMIR,
                        this.noOptimizeLlvm))
                .addTask(new CopyModuleJarTask(skipCopyLibsFromDist))
                .addTask(new RunTestsTask(), this.skipTests || isSingleFileBuild) 
                                                                                                
                .addTask(new CreateExecutableTask(), this.compile)  
                                                                                        
                .addTask(new CopyExecutableTask(outputPath), !isSingleFileBuild)    
                .addTask(new PrintExecutablePathTask(), this.compile)   
                .addTask(new RunCompilerPluginTask(), this.compile) 
                .addTask(new CleanTargetDirTask(), !isSingleFileBuild)  
                .build();
        
        taskExecutor.executeTasks(buildContext);
        
        if (this.exitWhenFinish) {
            Runtime.getRuntime().exit(0);
        }
    }

Line commented on: "you are trying to build/compile a module by giving the absolute path. You " +

Revised code:
public void execute() {
        if (this.helpFlag) {
            String commandUsageInfo = BLauncherCmd.getCommandUsageInfo(BUILD_COMMAND);
            this.errStream.println(commandUsageInfo);
            return;
        }

        String[] args = LaunchUtils
                .initConfigurations(this.argList == null ? new String[0] : this.argList.toArray(new String[0]));

        
        if (args.length > 1) {
            CommandUtil.printError(this.errStream, "too many arguments.", buildCmd, false);
            CommandUtil.exitError(this.exitWhenFinish);
            return;
        }
    
        
        if (!this.buildAll && (this.argList == null || this.argList.size() == 0)) {
            CommandUtil.printError(this.errStream,
                    "'build' command requires a module name or a Ballerina file to build/compile. Use '-a' or " +
                    "'--all' to build/compile all the modules of the project.",
                    "ballerina build {<ballerina-file> | <module-name> | -a | --all}",
                    false);
            CommandUtil.exitError(this.exitWhenFinish);
            return;
        }
        
        
        this.sourceRootPath = null != this.sourceRoot ?
                Paths.get(this.sourceRoot).toAbsolutePath() : this.sourceRootPath;
        Path sourcePath = null;
        Path targetPath;
        
        
        
        if (this.buildAll) {
            
            if (null != this.output) {
                CommandUtil.printError(this.errStream,
                                       "'-o' and '--output' are only supported when building a single Ballerina " +
                                               "file.",
                                       "ballerina build -o <output-file> <ballerina-file> ",
                                       true);
                CommandUtil.exitError(this.exitWhenFinish);
                return;
            }
        
            
            if (!ProjectDirs.isProject(this.sourceRootPath)) {
                Path findRoot = ProjectDirs.findProjectRoot(this.sourceRootPath);
                if (null == findRoot) {
                    CommandUtil.printError(this.errStream,
                                           "you are trying to build/compile a Ballerina project that does not have a " +
                                                   "Ballerina.toml file.",
                                           null,
                                           false);
                    CommandUtil.exitError(this.exitWhenFinish);
                    return;
                }
                
                this.sourceRootPath = findRoot;
            }
        
            targetPath = this.sourceRootPath.resolve(ProjectDirConstants.TARGET_DIR_NAME);

            if (args.length > 0) {
                CommandUtil.printError(this.errStream, "too many arguments.", buildCmd, false);
                CommandUtil.exitError(this.exitWhenFinish);
                return;
            }
        } else if (this.argList.get(0).endsWith(BLangConstants.BLANG_SRC_FILE_SUFFIX)) {
            
            if (this.compile) {
                CommandUtil.printError(this.errStream,
                                       "'-c' or '--compile' can only be used with modules.", null, false);
                CommandUtil.exitError(this.exitWhenFinish);
                return;
            } else {
                
                if (Paths.get(this.argList.get(0)).isAbsolute()) {
                    sourcePath = Paths.get(this.argList.get(0));
                    this.sourceRootPath = sourcePath.getParent();
                } else {
                    sourcePath = this.sourceRootPath.resolve(this.argList.get(0));
                }
                
                
                if (Files.notExists(sourcePath)) {
                    CommandUtil.printError(this.errStream,
                                           "'" + sourcePath + "' Ballerina file does not exist.",
                                           null,
                                           false);
                    CommandUtil.exitError(this.exitWhenFinish);
                    return;
                }
                
                
                if (!Files.isRegularFile(sourcePath)) {
                    CommandUtil.printError(this.errStream,
                                           "'" + sourcePath +
                                                   "' is not a Ballerina file. Check if it is a symlink or a shortcut.",
                                           null,
                                           false);
                    CommandUtil.exitError(this.exitWhenFinish);
                    return;
                }
                
                try {
                    targetPath = Files.createTempDirectory("ballerina-build-" + System.nanoTime());
                } catch (IOException e) {
                    throw LauncherUtils.createLauncherException("Error occurred when creating the executable.");
                }
            }
        } else if (Files.exists(
                this.sourceRootPath.resolve(ProjectDirConstants.SOURCE_DIR_NAME).resolve(this.argList.get(0))) &&
                Files.isDirectory(
                        this.sourceRootPath.resolve(ProjectDirConstants.SOURCE_DIR_NAME)
                                .resolve(this.argList.get(0)))) {

            
            
            if (null != this.output) {
                CommandUtil.printError(this.errStream,
                                       "'-o' and '--output' are only supported for building a single Ballerina " +
                                               "file.",
                                       null,
                                       false);
                CommandUtil.exitError(this.exitWhenFinish);
                return;
            }
            
            
            if (!RepoUtils.isBallerinaProject(this.sourceRootPath)) {
                CommandUtil.printError(this.errStream,
                        "you are trying to build/compile a module that is not inside a project.",
                        null,
                        false);
                CommandUtil.exitError(this.exitWhenFinish);
                return;
            }
            
            
            if (Paths.get(argList.get(0)).isAbsolute()) {
                CommandUtil.printError(this.errStream,
                                       "you are trying to build/compile a module giving the absolute path. You " +
                                               "only need to give the name of the module.",
                                       "ballerina build [-c] <module-name>",
                                       true);
                CommandUtil.exitError(this.exitWhenFinish);
                return;
            }
    
            String moduleName = argList.get(0);
    
            
            if (moduleName.endsWith("/")) {
                moduleName = moduleName.substring(0, moduleName.length() - 1);
            }
            
            sourcePath = Paths.get(moduleName);
            
            
            if (Files.notExists(this.sourceRootPath.resolve(ProjectDirConstants.SOURCE_DIR_NAME).resolve(sourcePath))) {
                CommandUtil.printError(this.errStream,
                        "'" + sourcePath + "' module does not exist.",
                        "ballerina build [-c] <module-name>",
                        true);
                CommandUtil.exitError(this.exitWhenFinish);
                return;
            }
    
            targetPath = this.sourceRootPath.resolve(ProjectDirConstants.TARGET_DIR_NAME);
        } else {
            CommandUtil.printError(this.errStream,
                                   "invalid Ballerina source path. It should either be a name of a module in a " +
                                   "Ballerina project or a file with a \'" + BLangConstants.BLANG_SRC_FILE_SUFFIX +
                                   "\' extension. Use -a or --all " +
                                   "to build or compile all modules.",
                                   "ballerina build {<ballerina-file> | <module-name> | -a | --all}",
                                   true);
            CommandUtil.exitError(this.exitWhenFinish);
            return;
        }
        
        
        this.sourceRootPath = this.sourceRootPath.normalize();
        sourcePath = sourcePath == null ? null : sourcePath.normalize();
        targetPath = targetPath.normalize();
        
        
        CompilerContext compilerContext = new CompilerContext();
        CompilerOptions options = CompilerOptions.getInstance(compilerContext);
        options.put(PROJECT_DIR, this.sourceRootPath.toString());
        options.put(OFFLINE, Boolean.toString(this.offline));
        options.put(COMPILER_PHASE, CompilerPhase.BIR_GEN.toString());
        options.put(LOCK_ENABLED, Boolean.toString(!this.skipLock));
        options.put(SKIP_TESTS, Boolean.toString(this.skipTests));
        options.put(TEST_ENABLED, "true");
        options.put(EXPERIMENTAL_FEATURES_ENABLED, Boolean.toString(this.experimentalFlag));
        options.put(PRESERVE_WHITESPACE, "true");
        
        BuildContext buildContext = new BuildContext(this.sourceRootPath, targetPath, sourcePath, compilerContext);
        buildContext.setOut(outStream);
        buildContext.setErr(errStream);
    
        boolean isSingleFileBuild = buildContext.getSourceType().equals(SINGLE_BAL_FILE);
        
        Path outputPath = null == this.output ? Paths.get(System.getProperty("user.dir")) : Paths.get(this.output);

        TaskExecutor taskExecutor = new TaskExecutor.TaskBuilder()
                .addTask(new CleanTargetDirTask(), isSingleFileBuild)   
                .addTask(new CreateTargetDirTask()) 
                .addTask(new CompileTask()) 
                .addTask(new CreateLockFileTask(), this.skipLock || isSingleFileBuild)  
                                                            
                .addTask(new CreateBaloTask(), isSingleFileBuild)   
                .addTask(new CreateBirTask())   
                .addTask(new CopyNativeLibTask(skipCopyLibsFromDist))    
                
                .addTask(new CreateJarTask(this.dumpBIR, skipCopyLibsFromDist, this.nativeBinary, this.dumpLLVMIR,
                        this.noOptimizeLlvm))
                .addTask(new CopyModuleJarTask(skipCopyLibsFromDist))
                .addTask(new RunTestsTask(), this.skipTests || isSingleFileBuild) 
                                                                                                
                .addTask(new CreateExecutableTask(), this.compile)  
                                                                                        
                .addTask(new CopyExecutableTask(outputPath), !isSingleFileBuild)    
                .addTask(new PrintExecutablePathTask(), this.compile)   
                .addTask(new RunCompilerPluginTask(), this.compile) 
                .addTask(new CleanTargetDirTask(), !isSingleFileBuild)  
                .build();
        
        taskExecutor.executeTasks(buildContext);
        
        if (this.exitWhenFinish) {
            Runtime.getRuntime().exit(0);
        }
    }