# Openmrs-API build error

**URL:** <https://talk.openmrs.org/t/openmrs-api-build-error/14829>\
**Category:** Development\
**Created:** [December 25, 2017, 9:31pm UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829 "2017-12-25T21:31:38Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajswarnam](https://talk.openmrs.org/letter_avatar/rajswarnam/32/5_5575768a8748004e209b776fc1b2916d.png) [@rajswarnam](https://talk.openmrs.org/u/rajswarnam)\
**Post date:** [December 25, 2017, 9:31pm UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829/1 "2017-12-25T21:31:39Z")

</div>

Hi, I am running into issues building openmrs-core straight out from Git - Master branch. Any ideas what I am missing? Please let me know.

Here is the pastebin error log - [https://pastebin.com/B7g3WvZG](https://pastebin.com/B7g3WvZG)

MVN version -

```
Maven home: /Users/kswarna/Documents/openmrs/apache-maven-3.5.2
Java version: 1.8.0_151, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.2", arch: "x86_64", family: "mac"

```

Below are the failing test

```
Failed tests: 
  OpenmrsTestsTest.shouldHaveAtLeastOneTest:44->getTestClasses:136->getClasses:153 org.openmrs.test should be a directory
  OpenmrsTestsTest.shouldHaveClassNameEndWithTestIfContainsMethodTestAnnotations:111->getClasses:153 org.openmrs.test should be a directory
  OpenmrsTestsTest.shouldHaveTestAnnotationWhenStartingWithShould:85->getTestClasses:136->getClasses:153 org.openmrs.test should be a directory
  OpenmrsTestsTest.shouldStartWithShould:57->getTestClasses:136->getClasses:153 org.openmrs.test should be a directory
  ModuleFactoryTest.loadModules_shouldNotStartTheLoadedModules:165 expected:<3> but was:<0>
  ModuleFactoryTest.loadModules_shouldSetupRequirementMappingsForEveryModule:147 expected:<3> but was:<0>
Tests in error: 
  ModuleFactoryTest.loadModule_shouldAlwaysLoadModuleIfReplacementIsWanted:76->loadModule:178 » Module
  ModuleFactoryTest.loadModule_shouldLoadANewerVersionOfTheSameModule:89->loadModule:178 » Module
  ModuleFactoryTest.loadModule_shouldLoadModuleIfItIsCurrentlyNotLoaded:53->loadModule:178 » Module
  ModuleFactoryTest.loadModule_shouldNotLoadAnOlderVersionOfTheSameModule:101->loadModule:178 » Module
  ModuleFactoryTest.startModule_shouldStartAllDependencies:115->loadModule:178 » Module
  ModuleUtilTest.expandJar_shouldExpandDirectoryWithParentTreeIfNameIsDirectoryAndKeepFullPathIsTrue:628 » FileNotFound
  ModuleUtilTest.expandJar_shouldExpandDirectoryWithoutParentTreeIfNameIsDirectoryAndKeepFullPathIsFalse:649 » FileNotFound
  ModuleUtilTest.expandJar_shouldExpandEntireJarIfNameIsEmptyString:667 » FileNotFound
  ModuleUtilTest.expandJar_shouldExpandEntireJarIfNameIsNull:683 » FileNotFound ...
  ModuleUtilTest.expandJar_shouldExpandFileWithParentTreeIfNameIsFileAndKeepFullPathIsTrue:699 » FileNotFound

Tests run: 3772, Failures: 6, Errors: 10, Skipped: 38

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] OpenMRS ............................................ SUCCESS [1.682 s]
[INFO] openmrs-tools ...................................... SUCCESS [0.868 s]
[INFO] openmrs-test ....................................... SUCCESS [0.080 s]
[INFO] openmrs-api ........................................ FAILURE [02:15 min]
[INFO] openmrs-web ........................................ SKIPPED
[INFO] openmrs-webapp ..................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:18 min
[INFO] Finished at: 2017-12-25T15:09:19-06:00
[INFO] Final Memory: 66M/738M
```

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [December 26, 2017, 7:31am UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829/2 "2017-12-26T07:31:45Z")

</div>

Delete it and try to clone afresh.

---

<div class="post-metadata">

**Author:** ![rajswarnam](https://talk.openmrs.org/letter_avatar/rajswarnam/32/5_5575768a8748004e209b776fc1b2916d.png) [@rajswarnam](https://talk.openmrs.org/u/rajswarnam)\
**Post date:** [December 26, 2017, 5:28pm UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829/3 "2017-12-26T17:28:19Z")

</div>

Thanks. I am wondering if this is related to Mac OS or JDK 1.8.0\_151-b12. I tried multiple time to delete and clone new, ended up with same results. I had access to a windows machine and it just works fine. JDK version of windows is 1.8.0\_141-b15.

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [December 26, 2017, 7:37pm UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829/4 "2017-12-26T19:37:49Z")

</div>

Is it any better if you upgrade your java to at least 1.8.0\_152?

Because it is a file access problem, can you also check the folder/file permissions?

---

<div class="post-metadata">

**Author:** ![rajswarnam](https://talk.openmrs.org/letter_avatar/rajswarnam/32/5_5575768a8748004e209b776fc1b2916d.png) [@rajswarnam](https://talk.openmrs.org/u/rajswarnam)\
**Post date:** [December 27, 2017, 4:41pm UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829/5 "2017-12-27T16:41:01Z")

</div>

The folder has read and execute permission to all users. I updated java to latest release 1.8.0\_152 it did not help. Not sure what I am missing.

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [December 27, 2017, 5:55pm UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829/6 "2017-12-27T17:55:05Z")

</div>

What do you have in this folder? /Users/kswarna/git/openmrs-core/api/target/test-classes/org/openmrs/module/include

---

<div class="post-metadata">

**Author:** ![rajswarnam](https://talk.openmrs.org/letter_avatar/rajswarnam/32/5_5575768a8748004e209b776fc1b2916d.png) [@rajswarnam](https://talk.openmrs.org/u/rajswarnam)\
**Post date:** [December 28, 2017, 7:52pm UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829/7 "2017-12-28T19:52:41Z")

</div>

@dkayiwa. Thanks. I think this is related to file path issue. I had a special character ‘@’ in the folder name and it was getting encoded to %40. I moved to a different directory structure and it worked. Thanks

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [December 28, 2017, 8:02pm UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829/8 "2017-12-28T20:02:07Z")

</div>

Which folder was it that had the ‘@’ character?

---

<div class="post-metadata">

**Author:** ![rajswarnam](https://talk.openmrs.org/letter_avatar/rajswarnam/32/5_5575768a8748004e209b776fc1b2916d.png) [@rajswarnam](https://talk.openmrs.org/u/rajswarnam)\
**Post date:** [December 28, 2017, 8:04pm UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829/9 "2017-12-28T20:04:02Z")

</div>

The folder structure - /users/email@domain.com/git/openmrs-core/api/target/test-classes/org/openmrs/module/include

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [December 28, 2017, 8:06pm UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829/10 "2017-12-28T20:06:06Z")

</div>

But the original one (which failed) did not have that character: /Users/kswarna/git/openmrs-core/api/target/test-classes/org/openmrs/module/include

---

<div class="post-metadata">

**Author:** ![rajswarnam](https://talk.openmrs.org/letter_avatar/rajswarnam/32/5_5575768a8748004e209b776fc1b2916d.png) [@rajswarnam](https://talk.openmrs.org/u/rajswarnam)\
**Post date:** [December 28, 2017, 8:09pm UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829/11 "2017-12-28T20:09:42Z")

</div>

Yes. I updated the email 🙂 before posting the thread, sorry about that.

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [December 28, 2017, 8:14pm UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829/12 "2017-12-28T20:14:39Z")

</div>

Does it compile if you take it back to? /Users/kswarna/git/openmrs-core

---

<div class="post-metadata">

**Author:** ![rajswarnam](https://talk.openmrs.org/letter_avatar/rajswarnam/32/5_5575768a8748004e209b776fc1b2916d.png) [@rajswarnam](https://talk.openmrs.org/u/rajswarnam)\
**Post date:** [December 28, 2017, 9:00pm UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829/13 "2017-12-28T21:00:01Z")

</div>

Yes it does. I moved it to /users/shared/openmrs/ and was able to build without any issues. I think other solution might be to decode filepath before running the testcase.

---

<div class="post-metadata">

**Author:** ![fnote](https://talk.openmrs.org/user_avatar/talk.openmrs.org/fnote/32/6972_2.png) [@fnote](https://talk.openmrs.org/u/fnote)\
**Post date:** [January 2, 2018, 7:50pm UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829/14 "2018-01-02T19:50:50Z")

</div>

Instead of running ‘mvn clean install’ command on the IDE (intelliJ IDEA) Terminal i used git bash to navigate to the project folder openmrs-core and ran ‘mvn clean install’ . it worked when i ran it on git bash instead if IDE terminal

---

<div class="post-metadata">

**Author:** ![adityac1305](https://talk.openmrs.org/letter_avatar/adityac1305/32/5_5575768a8748004e209b776fc1b2916d.png) [@adityac1305](https://talk.openmrs.org/u/adityac1305)\
**Post date:** [May 17, 2020, 9:07pm UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829/15 "2020-05-17T21:07:58Z")

</div>

Hi I am running into issues building openmrs-core from git master branch. Can someone help me with this ? Please let me know

[ERROR] Failures: [ERROR] ModuleFactoryTest.loadModules\_shouldNotStartTheLoadedModules:165 expected:\<3\> but was:\<0\> [ERROR] ModuleFactoryTest.loadModules\_shouldSetupRequirementMappingsForEveryModule:147 expected:\<3\> but was:\<0\> [ERROR] Errors: [ERROR] ModuleExtensionsTest.getExtensions\_shouldNotFailExpandingAnExtensionNameCausingANoClassDefinitionFoundError:96 ▒ Module [ERROR] ModuleFactoryTest.loadModule\_shouldAlwaysLoadModuleIfReplacementIsWanted:76-\>loadModule:179 ▒ Module [ERROR] ModuleFactoryTest.loadModule\_shouldLoadANewerVersionOfTheSameModule:89-\>loadModule:179 ▒ Module [ERROR] ModuleFactoryTest.loadModule\_shouldLoadModuleIfItIsCurrentlyNotLoaded:53-\>loadModule:179 ▒ Module [ERROR] ModuleFactoryTest.loadModule\_shouldNotLoadAnOlderVersionOfTheSameModule:101-\>loadModule:179 ▒ Module [ERROR] ModuleFactoryTest.startModule\_shouldStartAllDependencies:115-\>loadModule:179 ▒ Module [ERROR] ModuleFileParserTest.moduleFileParser\_shouldFailCreatingParserFromFileIfInputStreamClosed:92 ▒ FileNotFound [ERROR] ModuleFileParserTest.parse\_shouldParseValidLogicModuleFromFile:150 ▒ Module Un… [ERROR] ModuleFileParserTest.parse\_shouldParseValidXmlConfigCreatedFromInputStream:105 ▒ FileNotFound [ERROR] ModuleUtilTest.expandJar\_shouldExpandDirectoryWithParentTreeIfNameIsDirectoryAndKeepFullPathIsTrue:620 ▒ FileNotFound [ERROR] ModuleUtilTest.expandJar\_shouldExpandDirectoryWithoutParentTreeIfNameIsDirectoryAndKeepFullPathIsFalse:641 ▒ FileNotFound [ERROR] ModuleUtilTest.expandJar\_shouldExpandEntireJarIfNameIsEmptyString:659 ▒ FileNotFound [ERROR] ModuleUtilTest.expandJar\_shouldExpandEntireJarIfNameIsNull:675 ▒ FileNotFound … [ERROR] ModuleUtilTest.expandJar\_shouldExpandFileWithParentTreeIfNameIsFileAndKeepFullPathIsTrue:691 ▒ FileNotFound [ERROR] ModuleUtilTest.getPackagesFromFile\_shouldSkipOptionalFoldersIfJarFile:735 ▒ FileNotFound

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [May 17, 2020, 9:17pm UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829/16 "2020-05-17T21:17:49Z")

</div>

Remove spaces from the folder path where you put the openmrs source. Then compile again.

---

<div class="post-metadata">

**Author:** ![adityac1305](https://talk.openmrs.org/letter_avatar/adityac1305/32/5_5575768a8748004e209b776fc1b2916d.png) [@adityac1305](https://talk.openmrs.org/u/adityac1305)\
**Post date:** [May 17, 2020, 9:18pm UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829/17 "2020-05-17T21:18:17Z")

</div>

I am using git bash to do it my Maven and java are successfully set

$ mvn -version Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: C:\Program Files\apache-maven-3.6.3-bin\apache-maven-3.6.3 Java version: 1.8.0\_251, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0\_251\jre Default locale: en\_US, platform encoding: Cp1252 OS name: “windows 10”, version: “10.0”, arch: “amd64”, family: “windows”

$ java -version java version “1.8.0\_251” Java™ SE Runtime Environment (build 1.8.0\_251-b08) Java HotSpot™ 64-Bit Server VM (build 25.251-b08, mixed mode)

$ javac -version javac 1.8.0\_251

I was using this $ mvn clean package and was getting the following error

---

<div class="post-metadata">

**Author:** ![adityac1305](https://talk.openmrs.org/letter_avatar/adityac1305/32/5_5575768a8748004e209b776fc1b2916d.png) [@adityac1305](https://talk.openmrs.org/u/adityac1305)\
**Post date:** [May 17, 2020, 11:00pm UTC](https://talk.openmrs.org/t/openmrs-api-build-error/14829/18 "2020-05-17T23:00:09Z")

</div>

Yeah it worked for me thanks for your help

Regards, Aditya Chaudhari
