History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-1156
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Robin Shen
Votes: 2
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
QuickBuild

Trigger maven build if one of its dependency has been changed

Created: 01/Dec/11 11:53 PM   Updated: 27/Feb/13 01:03 PM
Component/s: None
Affects Version/s: 4.0.17
Fix Version/s: 5.0.8

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
Do I understand it correctly, that any pom.xml analysis has been dropped and has never got resurrected? Is there a chance to have it back? Otherwise the whole CI idea stops making sense for our maven-pom-based-huge-dependency-tree projects, as if an updated library snapshot does not trigger re-building all the gazillion applications which depend on this snapshot, automatic CI just stops working, as one needs to 1) know, which apps depend on which lib, 2) go through all of them and click "run" to trigger re-building. And, "no", referencing repositories to watch and trigger the build on commit won't work either. Neither does scheduled builds, just because of too many projects and interdependencies. Jenkins has this very proper pom-based dependency analysis which works very well. Having this in QB would be amazing too.

 All   Comments   Work Log   Change History      Sort Order:
Robin Shen [24/Jan/13 03:24 AM]
I was thinking about how it can be achieved in QB. A very brief thinking in my mind seems suggest to me that QB should allow a dynamically evaluated dependency set (instead of the "statically" defined one we have now). Each configuration will need to have information of "groupID + artifactID"(GA) and "groupID + artifactID + version" (GAV) exposed for dependency evaluation. For example, when project A is built, by inspecting the POM, we know that it depends on groupB:projB:1.0-SNAPSHOT. First we need to evaluate what is the "possible" dependent projects, which are all project with "groupB:projB". Update of source code will happen on the corresponding projects and the projects will return the whole GAV. Project A will only wait until the matching project (project B with groupB:projB:1.0-SNAPSHOT) finish its build.

Or, a similar but even simplier way: when project A is built, by inspecting the POM we know the set of maven dependencies it have, e.g. groupB:projB:1.0-SNAPSHOT. For each configuration built by Maven, we stored the last "GAV"s contained in that configuration. We simply make project A depends on configurations with matching GAVs of its dependencies, and wait until all dependent configuration finish building. Of course, once project B is built, we should also allow trigger build of all projects that depends on GAVs of project B. (Compared to previous suggest it may be not as smart in detecting version change but it will still work)

One more thing is to provide some "profile" or "maven space", so that dependencies are checked only for configurations assigned in the same "maven space".

Of course it is just something very very rough and need a lot of further polishing, but at least it looks like something fit with design of QB and is feasible.

Robin Shen [19/Feb/13 01:47 PM]
Refer to wiki for details of this feature:
http://wiki.pmease.com/display/QB50/Build+with+Maven

IgorT [20/Feb/13 08:02 AM]
Hi Robin. Just to be sure, will the QB be able to trace dependencies via parent pom.xml files as well? eg. one can only specify parent pom inside her application's pom.xml file and all the dependencies and their version may be living outside the application's pom, but in its parent's or parent's parent's pom.xml. Meaning, if you run {{mvn dependency:tree}} on your initial application pom.xml, maven will be able to pull and show all the dependencies, but if you only parse current pom.xml, it may not be enough. Thank you for your effort.

Robin Shen [20/Feb/13 09:16 AM]
QB runs command "mvn help:effective-pom" to analyze the output to get dependencies, so it can find dependencies defined in parent POMs.