ERROR: Setup O3 Dev environronment using SDK

Hello Team

Been Using openmrs-sdk-maven-plugin:4.4.0:setup-sdk and now am trying to setup the o3 environnment using SDK

However seen it requires org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:5.5.0:setup

On running the mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:5.5.0:setup-sdk am getting

muta-jonathan@muta-FX506HF:~$ mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:5.5.0:setup-sdk
[INFO] Scanning for projects...
[WARNING] The POM for org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:jar:5.5.0 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.073 s
[INFO] Finished at: 2024-01-31T14:11:34+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:5.5.0 or one of its dependencies could not be resolved: Failure to find org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:jar:5.5.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [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/PluginResolutionException

…Also running mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk still returns openmrs-sdk-maven-plugin:4.4.0:setup-sdk version … what am I missing

cc @dkayiwa @wikumc

What is your output for mvn -v?


muta-jonathan@muta-FX506HF:~$ mvn -v
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 11.0.21, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.15.0-92-generic", arch: "amd64", family: "unix"

Try deleting the .m2 cache (.m2/repository). Then install the SDK using the mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk

Okay let me give it a shoot

Oh thanks @wikumc now seeing it running on version openmrs-sdk-maven-plugin:5.1.0:setup-sdk :clap:

This is strange it should be installing the version 5.5.0. Can you share the m2/settings.xml file with us?

<?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">
  <profiles>
    <profile>
      <repositories>
        <repository>
          <id>openmrs-repo</id>
          <name>OpenMRS Repository</name>
          <url>https://mavenrepo.openmrs.org/public</url>
        </repository>
        <repository>
          <releases>
            <checksumPolicy>fail</checksumPolicy>
          </releases>
          <snapshots>
            <checksumPolicy>warn</checksumPolicy>
          </snapshots>
          <id>archetype</id>
          <url>https://mavenrepo.openmrs.org/public</url>
        </repository>
        <repository>
          <id>openmrs-repo-thirdparty</id>
          <name>OpenMRS Thirdparty Nexus Repository</name>
          <url>https://mavenrepo.openmrs.org/thirdparty</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>openmrs-repo</id>
          <name>OpenMRS Nexus Repository</name>
          <url>https://mavenrepo.openmrs.org/public</url>
        </pluginRepository>
      </pluginRepositories>
      <id>openmrs</id>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>openmrs</activeProfile>
  </activeProfiles>
  <pluginGroups>
    <pluginGroup>org.openmrs.maven.plugins</pluginGroup>
  </pluginGroups>
</settings>

@wikumc running it the second time has

openmrs-sdk-maven-plugin:5.5.0:setup-sdk now upgraded it

1 Like

however @wikumc running the setup still causes this issue

muta-jonathan@muta-FX506HF:~$ mvn openmrs-sdk:setup
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- openmrs-sdk-maven-plugin:5.5.0:setup (default-cli) @ standalone-pom ---

Setting up a new server...

Specify server id (-DserverId) (default: 'server'): 

You can setup the following servers:
1) 2.x Distribution
2) Platform
3) O3 Distribution

Which one do you choose? [1/2/3]: 3

You can deploy the following versions of O3:
1) Reference Application 3.0.0-SNAPSHOT
2) Reference Application 3.0.0-beta.16
3) Reference Application 3.0.0-beta.13
4) Reference Application 3.0.0-beta.12
5) Reference Application 3.0.0-beta.11
6) Other...

Which one do you choose? [1/2/3/4/5/6]: 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  8.189 s
[INFO] Finished at: 2024-01-31T16:01:41+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:5.5.0:setup (default-cli) on project standalone-pom: Failed to setup server: NullPointerException -> [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

yet this seemed installled already

muta-jonathan@muta-FX506HF:~$ mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- openmrs-sdk-maven-plugin:5.5.0:setup-sdk (default-cli) @ standalone-pom ---
[INFO] SDK installed successfully, settings file: /home/muta-jonathan/.m2/settings.xml
[INFO] Now you can use sdk: mvn openmrs-sdk:<task_name>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.068 s
[INFO] Finished at: 2024-01-31T16:01:28+03:00
[INFO] ------------------------------------------------------------------------

This is an issue we get when running the 3.0.0-SNAPSHOT. We fixed this error but haven’t made a release yet.

You will be able to set up 3.0.0-beta.16 without any issues. If you want to run 3.0.0-SNAPSHOT I suggest using the SDK version 5.6.0-SNAPSHOT. You might have to build it from the source.

3 Likes