Wiki Spaces

Documentation
Projects
Resources

Get Help from Others

Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack

Projects

Page tree

Versions Compared

Key

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

...

Code Block
languagexml
titlePlugin dependency in main pom.xml
<pluginManagement>
  <plugins>
    <plugin>
      <groupId>org.openmrs.maven.plugins</groupId>
      <artifactId>distrotools-maven-plugin</artifactId>
      <version>0.3</version>
    </plugin>
  </plugins>
</pluginManagement>

Goal Configuration

validate-forms

Performs basic validation (DOM validation, macro application) all HFE form files in a specified directory.

Configuration:

  • formsDirectory the directory containing the form files
    • Required: yes
    • Type: File
  • formsExtension the file extension used for form files
    • Required: no
    • Type: String
    • Default: html
Code Block
languagexml
titleExample configuration of validate-forms in omod/pom.xml
<plugin>
  <groupId>org.openmrs.maven.plugins</groupId>
  <artifactId>distrotools-maven-plugin</artifactId>
  <executions>
    <execution>
      <phase>validate</phase>
      <goals>
        <goal>validate-forms</goal>
      </goals>
      <configuration>
        <formsDirectory>src/main/webapp/resources/htmlforms</formsDirectory>
      </configuration>
    </execution>
  </executions>
</plugin>

generate-metadata-sources

Generates metadata reference source files from input XML files (for now this is just concepts and forms). This includes two files:

...

Code Block
titleExample configuration of generate-metadata-sources in api/pom.xml
<build>
  <plugins>
    <plugin>
      <groupId>org.openmrs.maven.plugins</groupId>
      <artifactId>distrotools-maven-plugin</artifactId>
      <executions>
        <execution>
          <phase>generate-sources</phase>
          <goals>
            <goal>generate-metadata-sources</goal>
          </goals>
          <configuration>
            <outputPackage>${project.parent.groupId}.${project.parent.artifactId}</outputPackage>
          </configuration>
        </execution>
      </executions>
    </plugin>
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>build-helper-maven-plugin</artifactId>
      <version>1.8</version>
      <executions>
        <execution>
          <id>add-source</id>
          <phase>generate-sources</phase>
          <goals>
            <goal>add-source</goal>
          </goals>
          <configuration>
            <sources>
              <source>${project.build.directory}/generated-sources/distro</source>
            </sources>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
  ...
  <filters>
    <filter>${project.build.directory}/metadata.properties</filter>
  </filters>
  ...
</build>

 

...

validate-forms

Performs basic validation (DOM validation, macro application) all HFE form files in a specified directory.

Configuration:

  • formsDirectory the directory containing the form files
    • Required: yes
    • Type: File
  • formsExtension the file extension used for form files
    • Required: no
    • Type: String
    • Default: html


Code Block
languagexml
titleExample configuration of validate-forms in omod/pom.xml
<plugin>
  <groupId>org.openmrs.maven.plugins</groupId>
  <artifactId>distrotools-maven-plugin</artifactId>
  <executions>
    <execution>
      <phase>validate</phase>
      <goals>
        <goal>validate-forms</goal>
      </goals>
      <configuration>
        <formsDirectory>src/main/webapp/resources/htmlforms</formsDirectory>
      </configuration>
    </execution>
  </executions>
</plugin>