The error is occuring at this step:
mvn openmrs-sdk:setup
This is the error:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:34 min
[INFO] Finished at: 2023-07-20T09:45:09-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:5.1.0:setup (default-cli) on project standalone-pom: Failed to setup server: Unable to execute mojo: Execution null of goal org.openmrs.maven.plugins:openmrs-sdk-docker-maven-plugin:5.1.0:create-mysql failed: Unsupported protocol scheme found: 'http://127.0.0.1:2375/ -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I’m still seeing an error after setting my sdk.properties to either of the following:
dockerHost=tcp://localhost:2375/
dockerHost=tcp://localhost:2375/
This is the error I’m getting:
Preparing 'openmrs-sdk-mysql-v3-2' DB docker container...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 44.136 s
[INFO] Finished at: 2023-07-20T14:48:23-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:5.1.0:setup (default-cli) on project standalone-pom: Failed to setup server:
[ERROR]
[ERROR]
[ERROR] Could not connect to Docker at tcp://localhost:2375/
[ERROR]
[ERROR] Please make sure Docker is running.
[ERROR]
[ERROR] If you are using 'Docker Toolbox', please make sure you run the SDK command
[ERROR] from the 'Docker Toolbox' terminal.
[ERROR]
[ERROR] If your Docker is running, try resetting the Docker host by running setup with -DdockerHost parameter.
[ERROR]
[ERROR] You can also set it manually by adding -DdockerHost="tcp://correct/url": org.apache.hc.client5.http.HttpHostConnectException: Connect to http://localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
PS D:\_YES_2023-05-28\OpenMrs> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
PS D:\_YES_2023-05-28\OpenMrs>
I have just revisited your post and basing on the error displayed, the Maven build failed while trying to execute the OpenMRS SDK plugin’s setup goal. The failure is related to Docker, as the plugin requires Docker to be running for the setup process. Docker is used to manage containers, and it seems like the SDK is unable to connect to the Docker daemon. On addition to your finding just incase the issue is not fixed kindly try out these:
Ensure Docker is installed on your system and running. It seems that the SDK plugin is trying to connect to Docker on tcp://localhost:2375/, but it cannot find the Docker daemon. Check your Docker installation and start the Docker service if it’s not running.
Check Docker Toolbox If you are running it on your machine, make sure you run the OpenMRS SDK command from the “Docker Toolbox” terminal. Docker Toolbox sets up a separate environment to work with Docker, and running the SDK command from the standard terminal might not work correctly.
If you have confirmed that Docker is running, but the issue persists, try resetting the Docker host. You can do this by re-running the SDK setup with the additional parameter -DdockerHost as follows: mvn openmrs-sdk:setup -DdockerHost="tcp://correct/url"
FYI Replace the "tcp://correct/url" with the correct URL or IP address of your Docker host.
Used the following from a Docker Toolbox cmd line: mvn openmrs-sdk:setup -DdockerHost=“tcp://<docker_ip_address>:2376” Where "docker_ip_address is the address given when Docker Desktop started up (see screen shot below).
The first time I ran the openmrs-sdk:setup it failed giving an error that it could not find a suitable driver for MySql. The second time the build succeeded.