i would to describe another scenario where having the ability to share a
workspace between jobs would be useful.
Note i want to keep using the built-in Maven 2 project type and not have to drop
to a 'free-style software project' and use shell scripting to get this job done.
Simply put I need to run maven more than once on the project to finish my build.
The build needs to do the following:
- Run a full build and generate results for all projects (i.e. "mvn install -fae
-Dmaven.test.failure.ignore=true"), yes ignore all failures.
- Run some data collection mojos across the now fully built project hierarchy
and then produce some reports (i.e. "mvn site -fae
-Dmaven.test.failure.ignore=true site:deploy")
Firstly a normal build is run and a number of code tools (checkstyle, pmd,
clover, cobertura, findbugs, javadoc, jxr) do their thing, these are my own
modified versions of the plugins that have all been changed to decouple their
analysis functionality from their reporting functionality. The reason we have
decoupled analysis from reporting is for the next stage.
The second invocation of mvn runs our custom plugins again (their bound to site
and pre-site phases), but this time in 'aggregate' mode. These 'aggregate' mojos
have the job of looking through the module hierarchy and aggregating (pulling up
and merging) the various result files they find (e.g. checkstyle-results.xml) up
the hierarchy, producing new analysis files as they go (i.e. for the parent pom
projects). The result of this is that at every level of the project hierarchy
one can see the aggregated results from JXR, javadoc, checkstyle, pmd, clover,
tests, etc.
Note, this is very different to the standard maven reporting plugin's aggregate
feature (i.e. <javadoc><aggregate>=true), when one uses these standard plugins
in aggregate mode only the top-most project gets the aggregated report, all the
other modules in the hierarchy do not generate any report at all.
Once the pre-site phase has run, the standard site plugin kicks. This in turn
runs all our reporting mojos and we get some rather lovely fully aggregated
multi-tier reports for javadoc, jxr, checkstyle, et al.
Was of doing this kind of thing with Hudson.
1) Prefered option? - Be able to define multiple build actions, i.e. dont chain
jobs but chain multiple build commands. a bit like the batch task functionality.
Thus you are in the same workspace as its the same job. Note this would need
some kind of 'continue if failed' functionality. I can see how this stretches
the hudson job model a bit so may not be viable for design reasons.
2) Call batch task on same project when main build finishes - this is what i'm
trying to do at the moment but unlike the 'Build other projects' post-build
action, the 'Invoke batch tasks of other projects' action does not have a
'Trigger even if the build is unstable' option which would allow us to only call
the batch task if the main build was successful (i.e. if the first mvn run fails
i do not want to call the batch task).
3) use seprate jobs, one that does the initial mvn build and then another, that
is downstream from that, shartes its workspace, and does the data aggregation
and site building. I think this one fits most easily into the hudson model...
Comments welcomed...
John
Oops, this an enhancement request, not a defect...