One of the things we have been meaning to do is convert our build framework over from ANT to Maven2. The time has come, and the work is in-progress (jira:fcrepo-394).

The basic strategy was laid out in our last face-to-face committers' meeting in Ithaca. As you can see, there are a few things that need to be done. If you are interested in helping, I would be very happy to coordinate efforts. Send an email to the group: "fedora-ant-to-maven@googlegroups.com"

Approach

Since moving to Maven2 requires significant restructuring of the baseline directories, we want to make small, incremental changes back to svn/trunk so that the on-going Fedora development does not become too far separated. This means that the ANT builds must continue to work as the baseline becomes incrementally transformed.

Progress/Status

(warning) Not yet
(info) Partial
(tick) Complete

* (tick) 1a - Source conformant to m2 standards (files and packages) + tweak build.xml

Commands

The following are some useful commands in working with the Fedora Maven2 builds

  1. mvn clean install
  2. mvn install -Dintegration.test.skip=true
  3. mvn install -Dmaven.test.skip=true
  4. mvn integration-test -P config[A|B|Q]
  5. mvn install -P fedora-installer

Unresolved

If you would like to help, these nuggets need a friend.

# (info) Currently, all of the maven dependencies are in the top-level pom.xml

    1. (tick) They need to be surgically pushed down to their appropriate subproject pom.xml
      1. An initial push down is complete though
    2. (tick) Their dependency declarations need to point to the proper version on maven-central, not the locally created artifact
      1. All of the artifacts that can be resolved to maven-central without selected new versions is complete
      2. Additional validation is needed especially to ensure that conflicts do not cause problems
    3. (tick) Libraries which cannot be resolved to maven-central need to added to the Duraspace Mave repository (under thirdparty)
    4. (tick) Libraries which are supplied by Duraspace projects need to be added to the Duraspace Maven repository (under releases)
    5. (info) The Duraspace Maven repository public groups need to be revised to NOT mirror maven-central or other public repositories
  1. The continued need for each junit suite aggregator class needs to be re-evaluated
  2. Unit test naming conventions need to be standardized (since maven invokes them based on a regex at different build phases)
    1. unit-test: '**/*Test.class'
    2. integration-test: '**/Test*.class'
  3. (tick) Unit/system/integration tests used to fall under 'fedora.test'
    1. now that they have been split across subprojects ('server', 'client', 'integrationtest'), they are not aggregated with a single call (i.e. fedora.test.AllUnitTests)
    2. a fix to this issue would only be needed as long as we continue to use ANT, Maven2 has its own test aggregation
  4. (tick) Build number & timestamp needed for artifact names and manifest files
  5. Refactor fedora.test.FedoraTestCase.java into two classes (one dependent on '/server' and one on '/client') so tests the inherit from it can be pushed back down from '/integrationtest' to their respective projects.
  6. fedora.test.integration.cma.SimpleDeploymentTests has a bug. See source file for details.
  7. In creating fedorahome.zip, deploy and undeploy *.wsdd files are token-swapped (e.g. 'Fedora-API-M-Port-SOAPHTTP' to 'management').
  8. (tick) Script needs to be written to support Maven Bamboo CI build
  9. (tick) The file server/src/main/resources/properties/lib.properties may be a candidate for removal as it was tied to the Ant build
  10. Libraries listed in server/src/resource/properties/install.properties do not automatically update with library updates and duplicate information in the pom which does not benefit from pom dependency checking
    1. (info) Updated to be consistent with Maven dependencies but still requires manual editing
  11. Split client into four modules in a branch (See Item 3 Above). Keep them under a client subdirectory.
    1. Swing Client
    2. FedoraClient Jar
    3. Messaging Client
    4. WebAdmin Client
  12. Experiment with saxon, fop and imagemanip stored under a localservices directory but being dependencies of fedora-repository. This may help Eclipse since each local service is a standalone, deployable war.

Rationale

Subproject break-out
generate

Finding the appropriate lines on which to draw subproject (maven module) boundaries is not an exact science.

During this initial conversion to Maven2, we want to minimize the degree of baseline upheaval while splitting out subprojects enough to allow maven to properly function.

A logical starting point is:

Where 'client' has a dependency on 'server', and they both depend on 'common'.
This becomes a little problematic with the introduction of wsdl stubs/skeletons and in the case of Fedora, second-level generated source code wrapping the generated wsdl stubs.

The generated artifacts are as follows:

The sequence of events to produce these artifacts is as follows:

  1. compile fedora class (BuildAxisStubWrapper.java)
  2. run axis-wsdl2java on fedora wsdl's
  3. run executable BuildAxisStubWrapper on wsdl2java outputs (wsdl-stubs)

The binary output of step-2 above is needed by 'server' during compilation.
The source output of step-2 above is needed as input to step-3.
The source output of step-3 above is needed by 'client' during compilation.

This being the case, the three-step sequence above can all be pushed down to 'common'.
The only problem here is that an executable BuildAxisStubWrapper is needed before the source-generation phase of running axis-wsdl2java.
Therefore, a fourth subproject is needed to create the BuildAxisStubWrapper executable: 'generate'.

integrationtest

There is a combination of unit, integration, and system tests within the baseline.
The 'integrationtest' subproject grew out of the need to have tests with dependencies on all of the other functional subprojects.

As it so happens, their is a test base class (FedoraTestCase.java) that is extended by several other tests from both 'server' and 'client'.
FedoraTestCase itself depends on both 'server' and 'client'.
Therefore, all tests that extend from FedoraTestCase are implicitly integration tests and have been migrated to the 'integrationtest' subproject.