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 me an email , Andrew Woods.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 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
Panel |
---|
Not yet |
- This was checked-into svn:fedora/trunk.rev.8076
- The basic structure of maven has been created (src/main/java, src/test/java, etc)
- The renaming of packages based on Maven-central's requirements will happen at the very end of this whole effort
- 1b - Get poms for all dependencies
- Based on the jars in the /lib dir, a simple install script pushes them into the local repository
- Need to create proper *.pom and <dependency> for each artifact
- 2 2a - Ant-maven integration (four eight subprojects) with main goal of installer.jargenerating source and building
- This initial integration requires a minimum break-out of the following subprojects
- This is just building, unit tests turned off
- This was checked-into svn:fedora/trunk.rev.8083
- generate
- This is a small project that creates the executable stubwrapper generator
- common
- This contains 'fedora.common' package
- includes wsdl2java generation and stubwrappers
- has dependencies on '/generate'
- server
- This is the 'fedora.server' package
- has dependencies on '/common'
- client
- This is the 'fedora.client' package
- has dependencies on both '/common' and '/server'
- integrationtest
- This is the 'fedora.test' package
- has dependencies on both '/client' and '/server'
- localservices
- This contains three sub-projects
- fop
- imagemanip
- saxon
- War files are created for all contained sub-projects when running
mvn clean install
- This contains three sub-projects
- democontent
- This creates a war file (fedora-demo.war) containing only demo content (no application code)
- installer
- This project has no source java files of its own
- It uses the 'assembly' plugin to aggregate other artifacts into
fedora-installer.jar
- To create
fedora-installer.jar
, run:mvn clean install -P fedora-installer
- generate
- 2b - All maven unit tests (test inventory)
- This was checked-into svn:fedora/trunk.rev.8086
- generate
- common
- server
- client
- integrationtest
- This was checked-into svn:fedora/trunk.rev.8086
- No unit tests here by definition
- 2c - All maven integration tests (test inventory)
- Like the system tests previously provided in the ANT tests (ConfigA/B/Q), for now, the Maven2 integration tests will require a pre-started application server.
- Because integration tests are run during the default build lifecycle of Maven2, you must pass the following flag at build-time to disable the running of integration tests ('integration.test.skip')
mvn clean install -Dintegration.test.skip=true
- *# generate
- common
- server
- client
- integrationtest
- 2d - All maven system tests (test inventory)
- These tests run within the 'integrationtest' project as separate profiles.
- This was checked-into svn:fedora/trunk.rev.8088
- *# ConfigA
mvn clean install -P configA
- ConfigB
mvn clean install -P configB
- ConfigQ
mvn clean install -P configQ
- 2e - installer.jar (and other artifacts verified)
- client.jar
- This is being created with the default build target: (
mvn package
) - Its artifact name contains the 'fedora' classifier (see note below for todo)
- This is being created with the default build target: (
- installer.jar
- rmi-journal-receiver.jar
- This was checked-into svn:fedora/trunk.rev.8114
- fedora-demo.war (democontent)
- local-services
- This was checked-into svn:fedora/trunk.rev.8092
- client.jar
- *# *## fop.war
- imagemanip.war
- saxon.war
- api.jar
- Is this still used?
- messaging-client.jar
- messaging-client.zip
- This was checked-into svn:fedora/trunk.rev.8113
- fedorahome.zip
- created by running:
mvn clean install -P fedora-installer
- created by running:
- fedora.war
- 3 - m2-only (full split-out)
- Admin Client (Swing)
- Java Client API (FedoraClient.jar)
- Messaging Client
- WebAdmin Client (Flex)
- Server Webapp
- Installer
- (Old GUI)
- New GUI
- 4 - Split out server modules as projects
- 5 - Rename packages based on Maven-central's requirements
Commands
The following are some useful commands in working with the Fedora Maven2 builds
mvn clean install
- builds all source code
- runs all unit & integration tests
mvn install -Dintegration.test.skip=true
- runs all unit tests
- skips all integration tests
mvn install -Dmaven.test.skip=true
- skips all unit tests
mvn integration-test -P config[A|B|Q]
- runs system tests per given configuration
mvn install -P fedora-installer
- generates fedora-installer.jar
- found in /installer/target
Unresolved
Panel |
---|
If you would like to help, these nuggets need a friend. |
- They need to be surgically pushed down to their appropriate subproject pom.xml
- An initial push down is complete though
- Their dependency declaration needs declarations need to point to the proper version on maven-central, not the locally created artifact
- All of the artifacts that can be resolved to maven-central without selected new versions is complete
- Additional validation is needed especially to ensure that conflicts do not cause problems
- Libraries which cannot be resolved to maven-central need to added to the Duraspace Mave repository (under thirdparty)
- Libraries which are supplied by Duraspace projects need to be added to the Duraspace Maven repository (under releases)
- The Duraspace Maven repository public groups need to be revised to NOT mirror maven-central or other public repositories
- They need to be surgically pushed down to their appropriate subproject pom.xml
- The continued need for each junit suite aggregator class needs to be re-evaluated
- Unit test naming conventions need to be standardized (since maven invokes them based on a regex at different build phases)
- unit-test: '**/*Test.class'
- integration-test: '**/Test*.class'
- All unit Unit/system/integration tests used to fall under 'fedora.test'
- now that they have been split across subprojects ('server', 'client', 'integrationtest'), they are not aggregated with a single call (i.e. fedora.test.AllUnitTests)
- a fix to this issue would only be needed as long as we continue to use ANT, Maven2 has its own test aggregation
- Build number & timestamp needed for artifact names and manifest files
client.jar
- needs 'fedora.version' in filename and manifest
- needs 'build.tstamp' in manifest
- The following is a plugin that should do the trick
- It should be configured in the top-level /pom.xml and /client/pom.xml
- http://mojo.codehaus.org/buildnumber-maven-plugin/index.html
- The build number plug-in fails if the SCM is unavailable or is not installed on the host platform. A <revisionOnScmFailure> parameter has been added to set a default build number. A warning is still shown during build but the build runs properly to completion. The default build number has been set to the "version" of the fedora-repository pom assuming that pom's version will eventually match a current or planned release.
- 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.
- fedora.test.integration.cma.SimpleDeploymentTests has a bug. See source file for details.
- In creating fedorahome.zip, deploy and undeploy *.wsdd files are token-swapped (e.g. 'Fedora-API-M-Port-SOAPHTTP' to 'management').
- This mangles token instances such as 'Fedora-API-M-Port-SOAPHTTP S'. This is a pre-existing bug.
- Script needs to be written to support Maven Bamboo CI build
- The file
server/src/main/resources/properties/lib.properties
may be a candidate for removal as it was tied to the Ant build - 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- Updated to be consistent with Maven dependencies but still requires manual editing
- Split client into four modules in a branch (See Item 3 Above). Keep them under a client subdirectory.
- Swing Client
- FedoraClient Jar
- Messaging Client
- WebAdmin Client
- 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
...
- Note: the source output is needed here instead of the binary because the generated source imports contains import statements with dependencies on packages within 'client'.
Therefore, the source output of step-2 is needed by 'client' before the compilation phase.
...