Getting an Error when running `mvn clean install openmrs-sdk:run`

I created a new module. When i run 'mvn clean install openmrs-sdk:run` i get the following error.

[ERROR] Failed to execute goal org.openmrs.maven.plugins:maven-openmrs-plugin:1.0.1:package-module (pack) on project basicexample-omod: Execution pack of goal org.openmrs.maven.plugins:maven-openmrs-plugin:1.0.1:package-module failed: A required class was missing while executing org.openmrs.maven.plugins:maven-openmrs-plugin:1.0.1:package-module: org/codehaus/plexus/util/FileUtils [ERROR] ----------------------------------------------------- [ERROR] realm = extension>org.openmrs.maven.plugins:maven-openmrs-plugin:1.0.1 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy [ERROR] urls[0] = file:/home/courage/.m2/repository/org/openmrs/maven/plugins/maven-openmrs-plugin/1.0.1/maven-openmrs-plugin-1.0.1.jar [ERROR] urls[1] = file:/home/courage/.m2/repository/org/apache/maven/maven-archiver/2.2/maven-archiver-2.2.jar [ERROR] urls[2] = file:/home/courage/.m2/repository/org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar [ERROR] urls[3] = file:/home/courage/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.1/plexus-interpolation-1.1.jar [ERROR] urls[4] = file:/home/courage/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar [ERROR] urls[5] = file:/home/courage/.m2/repository/org/apache/maven/shared/file-management/1.2.1/file-management-1.2.1.jar [ERROR] urls[6] = file:/home/courage/.m2/repository/org/apache/maven/shared/maven-shared-io/1.1/maven-shared-io-1.1.jar [ERROR] urls[7] = file:/home/courage/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.jar [ERROR] Number of foreign imports: 1 [ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]] [ERROR] [ERROR] -----------------------------------------------------: org.codehaus.plexus.util.FileUtils [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/PluginContainerException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :basicexample-omod

Any help will be appreciated. Thanks

Please post the full logs to pastebin.com and share the link here. Also I will love to know exactly how you created your module.

Here is the link to the output after creating a new module https://pastebin.com/LUhW1VMT

And here is the link to the full error log: https://pastebin.com/Mr5aYghb

Can you try building and running separately? That is

  1. mvn clean install

  2. mvn openmrs-sdk:run

Make sure you doing all that while in the root directory of your module.

Yea I cd into the module and ran the mvn install I still get the same error

When running which of the commands?

mvn clean install

Show me the output of

mvn -v

Java HotSpot™ 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0 Apache Maven 3.3.9 Maven home: /usr/share/maven Java version: 1.8.0_151, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-8-oracle/jre Default locale: en_US, platform encoding: UTF-8 OS name: “linux”, version: “4.10.0-42-generic”, arch: “amd64”, family: “unix”

Can you try upgrading maven? I’m having 3.5.0 and everything works fine. You can try that version or a version after that.

I still got same error with maven 3.5.2

Try building any other openmrs module you expect to pass and see if it passes.

Have you built openmrs-core before?

No. I haven’t

Try building openmr-core first. I’m not sure this will fix your issue but it’s usually advisable to build core before building modules.

Clone core from https://github.com/openmrs/openmrs-core and build with mvn clean install. Then try building your module again.

Ok. Am already running the mvn clean install :slight_smile: