I get an error when trying to setup the sdk on windows machine

I get this error

Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:3.2.0:setup-sdk (default-cli) on project standalone-pom: Failed to load settings.xml: Stream closed -> [Help 1]

when i run

mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk

Do you have the full stack trace?

 Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:3.2.0:setup-sdk (default-cli) on project standalone-pom: Failed to load settings.xml: Stream closed -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:3.2.0:setup-sdk (default-cli) on project standalone-pom: Failed to load settings.xml at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286) at org.apache.maven.cli.MavenCli.main(MavenCli.java:197) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to load settings.xml at org.openmrs.maven.plugins.utility.SettingsManager.(SettingsManager.java:72) at org.openmrs.maven.plugins.SetupSDK.executeTask(SetupSDK.java:39) at org.openmrs.maven.plugins.SetupSDK.execute(SetupSDK.java:29) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) … 20 more Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:151) at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) at java.io.BufferedInputStream.read(BufferedInputStream.java:254) at org.codehaus.plexus.util.xml.XmlReader.getBOMEncoding(XmlReader.java:635) at org.codehaus.plexus.util.xml.XmlReader.doRawStream(XmlReader.java:459) at org.codehaus.plexus.util.xml.XmlReader.(XmlReader.java:180) at org.codehaus.plexus.util.xml.XmlReader.(XmlReader.java:143) at org.codehaus.plexus.util.xml.XmlStreamReader.(XmlStreamReader.java:86) at org.codehaus.plexus.util.ReaderFactory.newXmlReader(ReaderFactory.java:104) at org.apache.maven.settings.io.xpp3.SettingsXpp3Reader.read(SettingsXpp3Reader.java:571) at org.openmrs.maven.plugins.utility.SettingsManager.(SettingsManager.java:70) … 24 more [ERROR] [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

Looks like a bug here:

@lluismf is right, that’s a bug, I’ve created issue https://issues.openmrs.org/browse/SDK-155. It will be fixed before next SDK release. At the moment, you can work it around by manually creating settings.xml file in your maven home directory:

 <?xml version="1.0" encoding="UTF-8"?>
 <settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 </settings>

and then run mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk. Thank you for reporting this bug :slight_smile:

Thank you for the alternative @gutkowski it has really worked

Thanks @taremwatadeo for your notifying us about this bug. It has been fixed in OpenMRS SDK 3.2.1 which was release today.

1 Like