Skip to content

Commit 2f5ab4a

Browse files
committed
EMMA-17: Update the basic module to the latest archetype
https://tickets.openmrs.org/browse/EMMA-17
1 parent 5b5bc13 commit 2f5ab4a

8 files changed

Lines changed: 79 additions & 129 deletions

File tree

omod/pom.xml

Lines changed: 64 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<artifactId>basicmodule</artifactId>
77
<version>0.1-SNAPSHOT</version>
88
</parent>
9-
<groupId>org.openmrs.module</groupId>
9+
1010
<artifactId>basicmodule-omod</artifactId>
1111
<packaging>jar</packaging>
1212
<name>Basic Module OMOD</name>
@@ -55,7 +55,7 @@
5555
</resource>
5656
<resource>
5757
<directory>src/main/webapp</directory>
58-
<filtering>true</filtering>
58+
<filtering>false</filtering>
5959
<excludes>
6060
<exclude>resources</exclude>
6161
</excludes>
@@ -70,24 +70,14 @@
7070
<targetPath>web/module</targetPath>
7171
</resource>
7272
</resources>
73+
7374
<testResources>
7475
<testResource>
7576
<directory>src/test/resources</directory>
7677
<filtering>true</filtering>
77-
<includes>
78-
<include>**/*.xml</include>
79-
<include>**/*.txt</include>
80-
</includes>
81-
</testResource>
82-
<testResource>
83-
<directory>src/test/resources</directory>
84-
<filtering>false</filtering>
85-
<excludes>
86-
<exclude>**/*.xml</exclude>
87-
<exclude>**/*.txt</exclude>
88-
</excludes>
8978
</testResource>
9079
</testResources>
80+
9181
<pluginManagement>
9282
<plugins>
9383
<plugin>
@@ -96,8 +86,48 @@
9686
<includeEmptyDirs>true</includeEmptyDirs>
9787
</configuration>
9888
</plugin>
89+
<!--This plugin's configuration is used to store Eclipse m2e settings
90+
only. It has no influence on the Maven build itself. -->
91+
<plugin>
92+
<groupId>org.eclipse.m2e</groupId>
93+
<artifactId>lifecycle-mapping</artifactId>
94+
<version>1.0.0</version>
95+
<configuration>
96+
<lifecycleMappingMetadata>
97+
<pluginExecutions>
98+
<pluginExecution>
99+
<pluginExecutionFilter>
100+
<groupId>org.openmrs.maven.plugins</groupId>
101+
<artifactId>maven-openmrs-plugin</artifactId>
102+
<versionRange>[1.0.1,)</versionRange>
103+
<goals>
104+
<goal>initialize-module</goal>
105+
</goals>
106+
</pluginExecutionFilter>
107+
<action>
108+
<ignore></ignore>
109+
</action>
110+
</pluginExecution>
111+
<pluginExecution>
112+
<pluginExecutionFilter>
113+
<groupId>org.apache.maven.plugins</groupId>
114+
<artifactId>maven-dependency-plugin</artifactId>
115+
<versionRange>[2.1,)</versionRange>
116+
<goals>
117+
<goal>unpack-dependencies</goal>
118+
</goals>
119+
</pluginExecutionFilter>
120+
<action>
121+
<ignore></ignore>
122+
</action>
123+
</pluginExecution>
124+
</pluginExecutions>
125+
</lifecycleMappingMetadata>
126+
</configuration>
127+
</plugin>
99128
</plugins>
100129
</pluginManagement>
130+
101131
<plugins>
102132
<plugin>
103133
<groupId>org.openmrs.maven.plugins</groupId>
@@ -120,14 +150,27 @@
120150
</execution>
121151
</executions>
122152
</plugin>
153+
<plugin>
154+
<groupId>org.apache.maven.plugins</groupId>
155+
<artifactId>maven-dependency-plugin</artifactId>
156+
<executions>
157+
<execution>
158+
<id>Expand moduleApplicationContext and messages</id>
159+
<goals>
160+
<goal>unpack-dependencies</goal>
161+
</goals>
162+
<phase>generate-resources</phase>
163+
<configuration>
164+
<includeGroupIds>${project.parent.groupId}</includeGroupIds>
165+
<includeArtifactIds>${project.parent.artifactId}-api</includeArtifactIds>
166+
<excludeTransitive>true</excludeTransitive>
167+
<includes>**/*</includes>
168+
<outputDirectory>${project.build.directory}/classes</outputDirectory>
169+
</configuration>
170+
</execution>
171+
</executions>
172+
</plugin>
123173
</plugins>
124174
</build>
125175

126-
<properties>
127-
<MODULE_ID>${project.parent.artifactId}</MODULE_ID>
128-
<MODULE_NAME>${project.parent.name}</MODULE_NAME>
129-
<MODULE_VERSION>${project.parent.version}</MODULE_VERSION>
130-
<MODULE_PACKAGE>${project.parent.groupId}.${project.parent.artifactId}</MODULE_PACKAGE>
131-
</properties>
132-
133176
</project>

omod/src/main/resources/config.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
<module configVersion="1.2">
44

55
<!-- Base Module Properties -->
6-
<id>basicmodule</id>
7-
<name>Basic Module</name>
8-
<version>0.1</version>
9-
<package>org.openmrs.module.@MODULE_ID@</package>
6+
<id>${project.parent.artifactId}</id>
7+
<name>${project.parent.name}</name>
8+
<version>${project.parent.version}</version>
9+
<package>${project.parent.groupId}.${project.parent.artifactId}</package>
1010
<author>Ben Wolfe</author>
1111
<description>
12-
Basic Module. Useful for creating other modules.
12+
${project.parent.description}
1313
</description>
1414

15-
<activator>@MODULE_PACKAGE@.BasicModuleActivator</activator>
15+
<activator>${project.parent.groupId}.${project.parent.artifactId}.BasicModuleActivator</activator>
1616

1717
<!-- <updateURL>https://modules.openmrs.org/modules/download/@MODULE_ID@/update.rdf</updateURL> -->
1818
<!-- /Base Module Properties -->
1919

20-
<require_version>1.7.0</require_version>
20+
<require_version>${openMRSVersion}</require_version>
2121

2222
<!-- Extensions -->
2323
<extension>

omod/src/main/resources/liquibase.xml

Lines changed: 0 additions & 40 deletions
This file was deleted.

omod/src/main/resources/messages.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

omod/src/main/resources/messages_es.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

omod/src/main/resources/messages_fr.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

omod/src/main/resources/moduleApplicationContext.xml renamed to omod/src/main/resources/webModuleApplicationContext.xml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<!-- Beans to add to the current Application context definition -->
4-
52
<beans xmlns="http://www.springframework.org/schema/beans"
63
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
74
xmlns:p="http://www.springframework.org/schema/p"
@@ -23,8 +20,13 @@
2320
http://www.springframework.org/schema/util
2421
http://www.springframework.org/schema/util/spring-util-3.0.xsd">
2522

26-
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>
27-
28-
<context:component-scan base-package="@MODULE_PACKAGE@.web.controller" />
23+
<!-- Add here beans related to the web context -->
2924

25+
26+
<!-- Annotation based controllers -->
27+
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>
28+
29+
<context:component-scan base-package="org.openmrs.module.basicmodule.web.controller" />
30+
31+
3032
</beans>

omod/src/test/java/org/openmrs/module/basicmodule/AdminListExtensionTest.java

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)