Red Hat Bugzilla – Bug 742872
As a project maintainer, I want my Maven modules to share Zanata configuration so that administration is easy
Last modified: 2012-04-23 00:33:11 EDT
Ideally, a Maven project with many modules should be able to supply a single zanata.xml, and each module in that project would push to and pull from the same Zanata server, and the same project. This will avoid the need to create a zanata.xml for each module, as well as a project in the Zanata server for each module.
The Maven plugin will need to make sure that documents from the different modules are separated, perhaps by prepending document names with the module ID.
And assuming each module has the same directory layout, it should be possible for all modules to inherit zanata-maven-plugin config from a parent pom.
NB: must consider what happens when deleting a module - will the corresponding documents be deleted from Zanata?
Implemented in the branch rhbz742872, merged into 1.4.
When the option -Dzanata.enableModules is set, Maven module IDs will be prepended to document names before pushing to the server, to look like this: org.example.groupId/org.example.artifactId/originalDocName
The reverse will happen when pulling from the server.
This should all work for any supported project type.
I've also added a -DdryRun option which doesn't change the server (for push) or the filesystem (for pull). There is a lot more information being logged now, which makes dry runs more useful.
For safety, obsolete modules will not be deleted from the server by default, but they will generate a log warning. The option -Dzanata.deleteObsoleteModules will enable deletion of docs from obsolete modules.
NB: when setting up the parent pom for a multi-module project, I found this useful for allowing all modules to share the same zanata.xml:
(Requires Maven 3)
merged into 1.4 and 1.5 branches
VERIFIED with client API version: 1.5-SNAPSHOT (20120210-1002), server API version: 1.5-SNAPSHOT(20120209-1459)