Error when setup openmrs

Hii I’m new to openmrs. When I tried to set up openmrs and I run the command mvn clean install openmrs-sdk:run -DserverId=your_server_id_here using my server id it shows the error " No plugin found for prefix ‘openmrs-SDK’ in the current project and in the plugin groups"

I searched and I found “mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk” this command but the same error occure when run the openmrs locally

Hello and welcome!

Can you post the exact version of mvn and java that is installed in your system?

Also, can you share the exact error log generated on running mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk ?

1 Like

Sorry for the late :frowning_face:

I’m using Maven 3.6.0 version and Java 1.8.0_242 version

My error message is

        [INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Basicexample 1.0.0-SNAPSHOT:
[INFO]
[INFO] Basicexample ....................................... SKIPPED
[INFO] Basicexample API ................................... SKIPPED
[INFO] Basicexample OMOD .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  17.229 s
[INFO] Finished at: 2020-02-22T10:39:01+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'openmrs-sdk' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/root/.m2/repository), openmrs-repo (http://mavenrepo.openmrs.org/nexus/content/repositories/public), central (https://repo.maven.apache.org/maven2)] -> [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/NoPluginFoundForPrefixException

Thank You very much for helping me to solve this problem :slight_smile:

  1. Firstly, ensure that openmrs-sdk is present in your local maven repository, ~/.m2/repository/org/openmrs/maven/openmrs-sdk, if not you will have to install it using

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

    (which shouldn’t throw No plugin found for prefix openmrs-sdk as we are using the fully qualified name of the plugin)

  2. The plugin prefixes are usually defined in ~/.m2/settings.xml file, check to see if that file contains

       <pluginGroups>
           <pluginGroup>org.openmrs.maven.plugins</pluginGroup>
      </pluginGroups>
    
1 Like

could you try to follow the steps here https://wiki.openmrs.org/display/docs/OpenMRS+SDK

1 Like

I couldn’t find any openmrs-sdk in ~/.m2/repository/org/openmrs/maven/ folder. So I run the command below

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

but it also not create any file or folder in that directory and the same error occurs.

the folders in maven directory are parents and plugins

And I don’t have any settings.xml file in ~/.m2/settings.xml :frowning: :frowning:

I tried but the same error message occurs :frowning: :frowning:

Can you share the output using pastebin.com

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

This command didn’t show any errors.

https://pastebin.com/raw/RkdAVRki

> Reactor Summary for Basicexample 1.0.0-SNAPSHOT:
> [INFO] 
> [INFO] Basicexample ....................................... SUCCESS [  1.107 s]
> [INFO] Basicexample API ................................... SKIPPED
> [INFO] Basicexample OMOD .................................. SKIPPED
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time:  1.584 s
> [INFO] Finished at: 2020-03-04T20:01:29+05:30

sudo mvn clean install openmrs-sdk:run -DserverId=server

this is the command which gave error.

The error is

https://pastebin.com/raw/UJvdzPpf

 BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.328 s
[INFO] Finished at: 2020-03-04T20:16:43+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'openmrs-sdk' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/root/.m2/repository), openmrs-repo (http://mavenrepo.openmrs.org/nexus/content/repositories/public), central (https://repo.maven.apache.org/maven2)] -> [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/NoPluginFoundForPrefixException

When I run the command without “sudo” it shows below error

https://pastebin.com/raw/21aqzgud

BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.830 s
[INFO] Finished at: 2020-03-04T20:19:15+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project basicexample-api: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] 
[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/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :basicexample-api

:frowning: :frowning:

@bhathiya95 Please cross check with these steps. I followed these when I was setting up my environment

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

Step 2: mvn openmrs-sdk:help

Step 3: mvn openmrs-sdk:setup-sdk -U

Step 4: mvn openmrs-sdk:setup

Step 5: Would you be willing to help us improve SDK by sending us once in a while anonymous usage statistics (you can always change your mind by going to sdk-stats.properties and setting statsEnabled to false) [Y/n]: Y

Step 6: Specify server id (-DserverId) (default: 'server'): Enter

Step 7: You can setup the following servers:

  1. Distribution
  2. Platform

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

Step 8: You can deploy the following versions of distribution:

  1. Reference Application 2.10.0-SNAPSHOT
  2. Reference Application 2.9.0
  3. Reference Application 2.8.1
  4. Reference Application 2.7.0
  5. Reference Application 2.6.1
  6. Other…

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

(DOWNLOADING TAKES PLACE)

Step 9: What port would you like your server to use? (default: '8080'): Enter

Step 10: If you want to enable remote debugging by default when running the server, specify the port number here (e.g. 1044). Leave blank to disable debugging. (Do not do this on a production server) (default: 'no debugging'): 1044

Step 11: Which database would you like to use?:

  1. MySQL 5.6 (requires pre-installed MySQL 5.6)
  2. MySQL 5.6 in SDK docker container (requires pre-installed Docker)
  3. Existing docker container (requires pre-installed Docker)

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

Step 12: The distribution requires MySQL database. Please specify database uri (-DdbUri) (default: 'jdbc:mysql://localhost:3306/@DBNAME@'): Enter

Step 13: Please specify database username (-DdbUser) (default: 'root'): Enter

Step 14: Please specify database password (-DdbPassword) (default: ' '): root (mysql root password)

Step 15: Would you like to setup the server using existing data (if not, all data will be lost)? [Y/n]: n

Database server has been wiped.

Importing an initial database from classpath://openmrs-platform.sql…

Database imported successfully.

The search index has been reset.

Step 16: Note: JDK 1.8 is needed for platform version 2.3.0.

Which JDK would you like to use to run this server?:

  1. JAVA_HOME (currently: /usr/lib/jvm/jdk1.8.0_241/jre)
  2. Other…

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

BUILD SUCCESS

Step 17: mvn openmrs-sdk:clone

Step 18: Please specify groupId (default: 'org.openmrs.module'): Enter

Step 19: Please specify artifactId: fhir2

Step 20: Please specify your GitHub username: Enter user name

Step 21: Please specify your GitHub password: Enter password

Forking openmrs-module-fhir2 from openmrs

Cloning from VaishSiddharth/openmrs-module-fhir2.git into /home/sid/openmrs-module-fhir2

BUILD SUCCESS

You don’t have to run mvn as root, but if you do then .m2 directory will be in /root/ path

@bhathiya95 hi did you get this solved

https://snipboard.io/1JKwiH.jpg @sidvaish97 @jwnasambu , could you advise on how to go about this?

Please don’t select 3.0.0-SNAPSHOT, i.e., pick option 2.

1 Like