Why do I get Maven plugin errors when installing OpenMRS SDK?

Tags: #<Tag:0x00007f0f22aeaed8> #<Tag:0x00007f0f22aea898>

I have have cloned openmrs-core from github and install using mvn install. At first i was having test failure and the build fails. Even when i skipped the tests using -Dmaven.test.skip=true i still had errors. It was suggested to me that i should skip test using -DskipTests=true instead and the build was successful. But now i am try to install the sdk using the command mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk -Dmaven.remote.repo=http://mavenrepo.openmrs.org/nexus/content/repositories/public as instructed on the openmrs sdk documentation page. But i get the following error:

[ERROR] Error resolving version for plugin ‘org.openmrs.maven.plugins:openmrs-sdk-maven-plugin’ from the repositories [local (/home/m0dz3r0/.m2/repository), central (https://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository -> [Help 1]

It should be noted that i am completely new to maven. I have not found any thing helpful using google search. Thanks in advance.

I have the same error. Has anyone resolved it?

i have skipped the sdk installation and proceeded to creating my introductory module using maven archetype mvn module-wizard:generate. The module is been generated successfully but when i run mvn clean install inside the module parent directory i get the following errors.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project helloworld-api: Compilation failure: Compilation failure:
[ERROR] error reading /home/m0dz3r0/.m2/repository/org/openmrs/api/openmrs-api/1.8.2/openmrs-api-1.8.2-tests.jar; error in opening zip file
[ERROR] error reading /home/m0dz3r0/.m2/repository/org/openmrs/web/openmrs-web/1.8.2/openmrs-web-1.8.2-tests.jar; error in opening zip file
[ERROR] error reading /home/m0dz3r0/.m2/repository/org/springframework/spring-test/3.0.5.RELEASE/spring-test-3.0.5.RELEASE.jar; error in opening zip file
[ERROR] error reading /home/m0dz3r0/.m2/repository/commons-logging/commons-logging/1.1/commons-logging-1.1.jar; error in opening zip file
[ERROR] error reading /home/m0dz3r0/.m2/repository/logkit/logkit/1.0.1/logkit-1.0.1.jar; error in opening zip file
[ERROR] error reading /home/m0dz3r0/.m2/repository/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar; error in opening zip file
[ERROR] error reading /home/m0dz3r0/.m2/repository/net/sourceforge/jtds/jtds/1.2.2/jtds-1.2.2.jar; error in opening zip file
[ERROR] error reading /home/m0dz3r0/.m2/repository/com/h2database/h2/1.2.135/h2-1.2.135.jar; error in opening zip file
[ERROR] error reading /home/m0dz3r0/.m2/repository/org/openmrs/api/openmrs-api/1.8.2/openmrs-api-1.8.2-tests.jar; error in opening zip file
[ERROR] error reading /home/m0dz3r0/.m2/repository/org/openmrs/web/openmrs-web/1.8.2/openmrs-web-1.8.2-tests.jar; error in opening zip file
[ERROR] error reading /home/m0dz3r0/.m2/repository/org/springframework/spring-test/3.0.5.RELEASE/spring-test-3.0.5.RELEASE.jar; error in opening zip file
[ERROR] error reading /home/m0dz3r0/.m2/repository/commons-logging/commons-logging/1.1/commons-logging-1.1.jar; error in opening zip file
[ERROR] error reading /home/m0dz3r0/.m2/repository/logkit/logkit/1.0.1/logkit-1.0.1.jar; error in opening zip file
[ERROR] error reading /home/m0dz3r0/.m2/repository/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar; error in opening zip file
[ERROR] error reading /home/m0dz3r0/.m2/repository/net/sourceforge/jtds/jtds/1.2.2/jtds-1.2.2.jar; error in opening zip file
[ERROR] error reading /home/m0dz3r0/.m2/repository/com/h2database/h2/1.2.135/h2-1.2.135.jar; error in opening zip file
[ERROR] /home/m0dz3r0/Program Files/eclipse/workspace/helloworld/api/src/test/java/org/openmrs/module/helloworld/api/HelloWorldServiceTest.java:[19,24] package org.openmrs.test does not exist
[ERROR] /home/m0dz3r0/Program Files/eclipse/workspace/helloworld/api/src/test/java/org/openmrs/module/helloworld/api/HelloWorldServiceTest.java:[24,45] cannot find symbol
[ERROR] symbol: class BaseModuleContextSensitiveTest
[ERROR] -> [Help 1]

I know the community is kind of busy now but these errors are driving me crazy. Any help will be appreciated. Thanks

Seems to contain corrupted libraries that am thinking were not successfully downloaded, i would suggest you delete /home/m0dz3r0/.m2/repository and re-run the mvn clean install command, otherwise manually look up each of those libraries independently, try opening the compressed files/.jar files and you will see what i mean! then manually delete their folders one after another, let us know how it goes.

1 Like

I think my problem started when i first installed OpenMRS. I was having test failures so i skipped the test but it seems some part of the application needed those tests. I deleted everything in my repository did a git clone again on the core api. So i am trying to install without skipping these tests. The build fails saying there are test failures. I looked at the test reports and found the test case that was failing. But when i run this test case in eclipse, i get no failures. More details:

Hello, Ivange!

Thank you for your feedback! We just fixed this problem, now you can just execute

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

to install SDK on your PC. See updated wiki

2 Likes

Hello,dmytro_trifonov

I will try that now and give you feedback. Thanks

Ivange Larry.

Hello dmytro_trifonov

Just want to let you know that the sdk installation was a success.Thanks.

Ivange Larry

3 Likes

I moved 14 posts to a new topic: Maven errors when compiling on Windows

Am currently experiencing this very error while installing a clean instance of OpenMRS sdk with no tests skipped:
[INFO] Running org.openmrs.api.UserServiceTest [ERROR] Tests run: 109, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 6.879 s <<< FAILURE! - in org.openmrs.api.UserServiceTest [ERROR] getAllUsers_shouldNotContainsAnyDuplicateUsers Time elapsed: 0.09 s <<< FAILURE! org.opentest4j.AssertionFailedError: expected: <11> but was: <12> at org.openmrs.api.UserServiceTest.getAllUsers_shouldNotContainsAnyDuplicateUsers(UserServiceTest.java:680)

@mozzy any idea?

can you post the error in pasterbin ??

what commands are you exactly running ??

at quick glance at the error , you seem to be building the OpenMRS core not installing the SDK

Yes am building by navigating to the openmrs-core directory then running mvn clean package

here is the pastebin url: pasteBin

can you paste the entire build logs ?? i want to have a look at your OpenMRS core directory path and some other log details

Alright. Entire build log

can you try with mvn clean install -U , and paste again the logs ??