Bug 742872

Summary: As a project maintainer, I want my Maven modules to share Zanata configuration so that administration is easy
Product: [Community] Zanata Reporter: Sean Flanigan <sflaniga>
Component: Component-MavenAssignee: David Mason <damason>
Status: CLOSED CURRENTRELEASE QA Contact: Ding-Yi Chen <dchen>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.4CC: camunoz, zanata-bugs
Target Milestone: ---Keywords: Improvement, UserStory
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://community.rallydev.com/slm/rally.sp#/detail/userstory/4467300219
See Also: https://bugzilla.redhat.com/show_bug.cgi?id=760390
Fixed In Version: 1.5-SNAPSHOT (20120210-1002) Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-23 00:33:11 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 748696, 756230    

Description Sean Flanigan 2011-10-03 04:04:32 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?
Comment 1 Sean Flanigan 2011-12-14 21:35:11 EST
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)
Comment 4 David Mason 2011-12-19 23:52:10 EST
merged into 1.4 and 1.5 branches

see: https://github.com/zanata/zanata/commit/4580bd887d2874113e22bc290c967115e03928a1
Comment 9 Ding-Yi Chen 2012-02-09 23:57:50 EST
VERIFIED with client API version: 1.5-SNAPSHOT (20120210-1002), server API version: 1.5-SNAPSHOT(20120209-1459)