Locked History Actions

deegree3/Maven

Maven

This page should be used to summarize deegree specifics when using maven.

1. Parent POMs

There are a couple of parent pom.xml files that can be used to quickly set up new maven projects for use in or with deegree. The following sections describe how to use them and what their effect is.

Here's how to use a pom that you've selected as suitable for your project. Just replace the artifactId with the actual artifactId of the parent you want to use.

  <parent>
    <groupId>org.deegree</groupId>
    <artifactId>deegree-parent</artifactId>
    <version>3.1-SNAPSHOT</version>
  </parent>

  <repositories>
    <repository>
      <id>deegree-repo</id>
      <url>http://artefacts.deegree.org/repo</url>
      <releases>
        <updatePolicy>never</updatePolicy>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

1.1. deegree-parent

Use this parent for plain jar projects within or using deegree.

  • includes src/main/resources and src/main/filtered as unfiltered and filtered resource directories

  • sets source and target compiler version to 1.6
  • increases javadoc plugin heap memory
  • includes distribution management settings
  • specifies deegree artefact server as additional plugin repository

1.2. deegree-service-parent

Use this parent for deegree service war projects.

  • includes deegree-parent
  • automatically unpacks the deegree-services-console into src/main/webapp

  • includes dependencies required for running a deegree service and the console

1.3. deegree-tomcat-parent

Use this parent for deegree service war projects for which you want to add a distribution bundled with a tomcat.

  • includes deegree-service-parent
  • automatically unpacks a tomcat into target/deegree-tomcat, including the deegree tomcat startup scripts
  • is set up to produce an assembly using descriptor assembly.xml (you should provide this one yourself)

1.4. deegree-stable-service-parent

Use this parent for deegree service war projects with automatic integration testing (this one should be preferred for most services compared to the plain deegree-service-parent).

  • includes deegree-service-parent
  • is set up to startup a tomcat with the webapp prior to integration tests
  • is set up to automatically run the deegree-maven-plugin goal test-services as integration test

1.5. deegree-test-parent

Intended mainly for use of deegree CITE service setups, to enable automatic testing using the TEAM engine.

  • includes deegree-service-parent
  • adds resource filtering of src/test/resources

  • is set up to startup a tomcat with the webapp prior to integration tests
  • is set up to run all *IT test classes as integration tests
  • adds dependencies to TEAM engine custom .jars and junit

2. deegree-maven-plugin

The deegree maven plugin includes a couple of random goals that may or may not be useful for you.

Include the plugin as follows:

      <plugin>
        <groupId>org.deegree</groupId>
        <artifactId>deegree-maven-plugin</artifactId>
        <version>1.0-SNAPSHOT</version>
        <executions>
...
        </executions>
      </plugin>

2.1. copy goal

The copy goal can be used to copy files around in your project. Bound to phase generate-resources by default. Use as follows:

          <execution>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <files>
                <file>
                  <from>external-resources/foo/bar.zip</from>
                  <to>target/distribution/foobar-1.0.zip</to>
                </file>
              </files>
            </configuration>
          </execution>

The configuration can include multiple file elements.

2.2. generate-portnumber goal

This goal can be used to generate a unique portnumber for each run. It's bound to phase initialize by default. The resulting portnumber can be used using the property ${portnumber}. Use as follows:

          <execution>
            <goals>
              <goal>generate-portnumber</goal>
            </goals>
          </execution>

2.3. test-services goal

This goal is used to initiate a number of automatic integration tests against a deegree webservice. It is bound to the phase integration-test by default. Use as follows:

          <execution>
            <goals>
              <goal>test-services</goal>
            </goals>
          </execution>

It currently includes the following tests:

  • test GetCapabilities against each configured service to see if it started up correctly, fails if the service responds with a service exception

  • test GetMap requests against each configured layer with its maximum bounding box, fails if the service does not respond with a map

  • search src/test/requests and its subdirectories for *.kvp or *.xml files, send these requests via HTTP GET resp. POST to the service and compare the result with the corresponding *.response byte by byte. If the resulting ratio between matched/read bytes is lower that 0.99, the mojo fails.

Configuration options:

  • testCapabilities: default is true, set to false to omit the GetCapabilities tests

  • testLayers: default is true, set to false to omit the GetMap tests

  • testRequests: default is true, set to false to omit the request tests
  • workspace: default is ${project.basedir}/src/main/webapp/WEB-INF/workspace, set to your workspace directory if its located somewhere else


CategoryDeegree3