How to execute 'update-sql' command in Spring application?

Hi,

I’m now developing Spring web application to provide command execution service.

‘update’ command works well but there is ‘unknown command error’ when use ‘update-sql’.

I tried ‘updateSQL’ but it seems I need to add maven argument type like ‘–url’ but I want to use ‘addArgumentValue’.

Anyone knows about this error?

Thanks.

liquibase version : 4.10.0

   public String updateChangeLogs(String command) {

        CommandResults commandResults = null;
        try {
             commandResults = new CommandScope(command)
                    .addArgumentValue("url", "jdbc:postgresql://localhost:5434/dev")
                    .addArgumentValue("username", "david")
                    .addArgumentValue("password","david123")
                    .addArgumentValue("changelogFile", "/liquibase.xml")
                    .execute();
        } catch (CommandExecutionException e) {
            log.warn("Error running update: "+e.getMessage());
            return e.getMessage();
        } catch (Exception e){
            return e.getMessage();
        }
        return "success";
    }

when run ‘update’ command

Liquibase Community 4.10.0 by Liquibase
####################################################
##   _     _             _ _                      ##
##  | |   (_)           (_) |                     ##
##  | |    _  __ _ _   _ _| |__   __ _ ___  ___   ##
##  | |   | |/ _` | | | | | '_ \ / _` / __|/ _ \  ##
##  | |___| | (_| | |_| | | |_) | (_| \__ \  __/  ##
##  \_____/_|\__, |\__,_|_|_.__/ \__,_|___/\___|  ##
##              | |                               ##
##              |_|                               ##
##                                                ## 
##  Get documentation at docs.liquibase.com       ##
##  Get certified courses at learn.liquibase.com  ## 
##  Free schema change activity reports at        ##
##      https://hub.liquibase.com                 ##
##                                                ##
####################################################
Starting Liquibase at 16:03:35 (version 4.10.0 #2501 built at 2022-05-04 14:27+0000)
Unexpected error running Liquibase: Validation Failed:
     1 change sets check sum
          liquibase/ifm/version/changeset-v2.2.0.xml::v2.2.0_0002::davidTest was: 8:50439e19984b8b356c7148893e4187d1 but is now: 8:0a0f494e8201a88ded82c9d8167cb6c0

when run ‘update-sql’ command.

Unknown command 'update-sql'