Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A module can only access the api/service of another module if it is marked as required.  The classloaders restrict this.  The reasoning is both to make classloading faster and to prevent classloading errors if the other module does not exist in a running openmrs.

...

If you have a mavenized module:

  1. In your module's root pom.xml you need something like this:

    Code Block
    <dependencyManagement>
    	<dependencies>
    		<!-- Depends on ZZZ module -->
    		<dependency>
    			<groupId>org.openmrs.module</groupId>
    			<artifactId>themoduleid-api</artifactId>
    			<version>1.0</version>
    			<type>jar</type>
    			<scope>provided</scope>
    		</dependency>
    		...
    	</dependencies>
    </dependencyManagement>
    


  2. In your module's omod/pom.xml you need something like this:

    Code Block
    <dependency>
    	<groupId>org.openmrs.module</groupId>
    	<artifactId>themoduleid-api</artifactId>
    </dependency>
    


...