From 4abbad55baee4383f4e6ccbb06f9302e5cb0554f Mon Sep 17 00:00:00 2001 From: vmassol Date: Fri, 18 Feb 2005 18:39:57 +0000 Subject: [PATCH] - Compute automatically the merge directory automatically (the value of maven.cruisecontrol.logs.mergedirectory if not specified by the user. The computation uses the maven.build.dir property to guess the output directory for JUnit test results. - Added a new maven.cruisecontrol.logs.pattern property to specify the report files that will be merged by CC. Defaults to *.xml. - Added a new cruisecontrol:install-local goal to install the generated CC config to a target location on the same machine (it uses a file copy). In the future we could provide other installation mechanisms like ssh, scp, etc. - Changed the default build status file name to be status.txt which is the default value expected by the CC Webapp. - New maven.cruisecontrol.work.dir property that specifies what CC work directory to use for the project. Default values of maven.cruisecontrol.checkout.dir and maven.cruisecontrol.logs.dir have been modified to be relative to it. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@154334 13f79535-47bb-0310-9956-ffa450edef68 --- cruisecontrol/plugin.jelly | 81 ++++++++- cruisecontrol/plugin.properties | 37 +++- .../src/plugin-resources/cruisecontrol.jsl | 11 +- cruisecontrol/xdocs/changes.xml | 39 ++++- cruisecontrol/xdocs/faq.fml | 49 ++++-- cruisecontrol/xdocs/goals.xml | 11 +- cruisecontrol/xdocs/navigation.xml | 4 +- cruisecontrol/xdocs/properties.xml | 163 ++++++++---------- 8 files changed, 254 insertions(+), 141 deletions(-) diff --git a/cruisecontrol/plugin.jelly b/cruisecontrol/plugin.jelly index 9feb9ff4..6e0597b7 100644 --- a/cruisecontrol/plugin.jelly +++ b/cruisecontrol/plugin.jelly @@ -1,7 +1,8 @@ + - + xmlns:doc="doc" + xmlns:maven="jelly:maven"> @@ -46,6 +47,26 @@ ${pom.build.nagEmailAddress} + + + + + + + + + + + + + + + + + @@ -70,10 +91,13 @@ - + + + value="${maven.cruisecontrol.build.dir}/config-temp.xml" /> @@ -81,6 +105,7 @@ + @@ -89,10 +114,48 @@ - - - - + + + + + + + + + + + You must have a work directory (${maven.cruisecontrol.work.dir}) set up before trying to run Cruisecontrol. + + + + + + + + + + + + + + + You need to customize maven.cruisecontrol.work.dir to the real location + + + + + + + + diff --git a/cruisecontrol/plugin.properties b/cruisecontrol/plugin.properties index 9107cdfa..9198f58e 100644 --- a/cruisecontrol/plugin.properties +++ b/cruisecontrol/plugin.properties @@ -1,5 +1,5 @@ # ------------------------------------------------------------------- -# Copyright 2001-2004 The Apache Software Foundation. +# Copyright 2001-2005 The Apache Software Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,17 +14,40 @@ # limitations under the License. # ------------------------------------------------------------------- -maven.cruisecontrol.config=${basedir}/cruisecontrol.xml +# Location where the CruiseControl configuration file will be generated. +maven.cruisecontrol.build.dir = ${maven.build.dir}/cruisecontrol +maven.cruisecontrol.config = ${maven.cruisecontrol.build.dir}/config.xml + +# Properties that are used for generating the content of the CC config file +# ------------------------------------------------------------------------- + +# By default we create a CC work directory that is executable from Maven's +# build directory. In practice you'll probably want to execute CC from +# another machine and you'll need to change the maven.cruisecontrol.work.dir +# property to make it match the location where you wish to put the work dir +# on this other machine. + +maven.cruisecontrol.work.dir=${maven.cruisecontrol.build.dir} +maven.cruisecontrol.checkout.dir=${maven.cruisecontrol.work.dir}/checkout +maven.cruisecontrol.logs.dir=${maven.cruisecontrol.work.dir}/logs + maven.cruisecontrol.mavenhome=${maven.home} + maven.cruisecontrol.schedule.type=interval maven.cruisecontrol.schedule.interval=300 maven.cruisecontrol.schedule.time=1900 -maven.cruisecontrol.checkout.dir=${basedir}/checkout -maven.cruisecontrol.logs.encodingtype=ISO-8859-1 -maven.cruisecontrol.logs.dir=${maven.build.dir}/cc-logs -maven.cruisecontrol.logs.mergedirectory=${maven.cruisecontrol.checkout.dir}/${module}/target/test-reports + +# If left undefined this property is computed automatically by the plugin +# from the ${maven.build.dir} property. +#maven.cruisecontrol.logs.mergedirectory=${maven.cruisecontrol.checkout.dir}/${module}/target/test-reports + maven.cruisecontrol.logs.merge=true -maven.cruisecontrol.currentbuildstatus.filename=currentbuildstatus.txt +maven.cruisecontrol.logs.encodingtype=ISO-8859-1 +maven.cruisecontrol.logs.pattern=*.xml + +maven.cruisecontrol.currentbuildstatus.filename=status.txt + +# TODO: Once the SCM plugin 1.5 is released, modify the first goal to be scm:update maven.cruisecontrol.goals=scm:update-project|clean test|site:deploy maven.cruisecontrol.mail.host=localhost diff --git a/cruisecontrol/src/plugin-resources/cruisecontrol.jsl b/cruisecontrol/src/plugin-resources/cruisecontrol.jsl index 877d15b5..49e435ff 100644 --- a/cruisecontrol/src/plugin-resources/cruisecontrol.jsl +++ b/cruisecontrol/src/plugin-resources/cruisecontrol.jsl @@ -32,8 +32,6 @@ - - @@ -44,14 +42,9 @@ - - - - - @@ -60,7 +53,6 @@ - @@ -89,7 +81,8 @@ dir="${maven.cruisecontrol.logs.dir}/${pom.artifactId}"> - + diff --git a/cruisecontrol/xdocs/changes.xml b/cruisecontrol/xdocs/changes.xml index 8d97d794..18053200 100644 --- a/cruisecontrol/xdocs/changes.xml +++ b/cruisecontrol/xdocs/changes.xml @@ -22,19 +22,50 @@ Changes Brett Porter + Vincent Massol - - Fix order in which the CruiseControl's <project> - elements are generated. They must be in the order of the less - dependent project first. + + Compute automatically the merge directory automatically (the + value of maven.cruisecontrol.logs.mergedirectory + if not specified by the user. The computation uses the + maven.build.dir property to guess the output + directory for JUnit test results. + + + Added a new maven.cruisecontrol.logs.pattern property + to specify the report files that will be merged by CC. Defaults to + *.xml. + + + Added a new cruisecontrol:install-local goal + to install the generated CC config to a target location on + the same machine (it uses a file copy). In the future we could + provide other installation mechanisms like ssh, scp, etc. + + + Changed the default build status file name to be + status.txt which is the default value + expected by the CC Webapp. + + + New maven.cruisecontrol.work.dir property that specifies + what CC work directory to use for the project. Default values of + maven.cruisecontrol.checkout.dir and + maven.cruisecontrol.logs.dir have been modified to be + relative to it. Fixed default property values for maven.cruisecontrol.mail.xlsdir and maven.cruisecontrol.mail.css so that the plugin works by default with the latest CC version (2.2.1). + + Fix order in which the CruiseControl's <project> + elements are generated. They must be in the order of the less + dependent project first. + Lost script extension when use "maven cruisecontrol:configure" command diff --git a/cruisecontrol/xdocs/faq.fml b/cruisecontrol/xdocs/faq.fml index 1718d0b2..fe1ddfbf 100644 --- a/cruisecontrol/xdocs/faq.fml +++ b/cruisecontrol/xdocs/faq.fml @@ -1,7 +1,8 @@ + - @@ -67,23 +67,6 @@ maven.cruisecontrol.template=${plugin.resources}/my-cc-template.jsl]]> - - How can I generate just a single configuration file for multiple projects? - - A neat trick of the cruisecontrol plugin is that if you specify a single configuration file for all your - projects, then the plugin will just install/update the one your are working on. So, in your project.xml - set maven.cruisecontrol.config=c:/cruisecontrol.xml or maybe - maven.cruisecontrol.config=${maven.cruisecontrol.home}/cruisecontrol.xml for use in cross - platform situations. Unfortunantly, I haven't been able to have a plugin set this value, so you need - to put it in all your projects. -

- Something else to keep in mind is that if you are using the cruisecontrol goal to update your - cruisecontrol.xml file with information in the project.xml then you will need to update the file fairly - frequently as new developers are added. I use a simple cron job to stop CruiseControl, call the multiproject - goal, and then restart CruiseControl. - - - How do I setup my project to be built using Cruise Control? @@ -142,5 +125,33 @@ maven.cruisecontrol.template=${plugin.resources}/my-cc-template.jsl]]> + + Multiprojects + + + How can I generate just a single configuration file for multiple projects? + + A neat trick of the cruisecontrol plugin is that if you specify a single configuration + file for all your projects, then the plugin will just install/update the one your are + working on. + However the cruisecontrol plugin does not currently support having one CC project + definitions per Maven subproject. The currently recommended solution is to have one CC + project for your multiproject (i.e. viewing the multiproject project as one project only). + + + + + How can I tell CC to correctly merge JUnit logs for a multiproject setup? + + Define the following 2 properties in the project.properties file of your master project: + + + + + + diff --git a/cruisecontrol/xdocs/goals.xml b/cruisecontrol/xdocs/goals.xml index f35bd41d..2355ab71 100644 --- a/cruisecontrol/xdocs/goals.xml +++ b/cruisecontrol/xdocs/goals.xml @@ -1,7 +1,8 @@ + - Maven Cruise Control Plug-in Goals @@ -36,6 +36,13 @@ cruisecontrol:run Run Cruise Control + + cruisecontrol:install-local + + Install the generated CC config to a target location on the same + machine (it uses a file copy). + + diff --git a/cruisecontrol/xdocs/navigation.xml b/cruisecontrol/xdocs/navigation.xml index fae1ffdd..bc49cbad 100644 --- a/cruisecontrol/xdocs/navigation.xml +++ b/cruisecontrol/xdocs/navigation.xml @@ -1,7 +1,8 @@ + - Maven Cruise Control Plug-in diff --git a/cruisecontrol/xdocs/properties.xml b/cruisecontrol/xdocs/properties.xml index 086ab74c..093d1f0a 100644 --- a/cruisecontrol/xdocs/properties.xml +++ b/cruisecontrol/xdocs/properties.xml @@ -1,7 +1,8 @@ - + + - - Maven Cruise Control Plug-in Properties + Maven CruiseControl Plug-in Properties -

+
+ + + + + - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - @@ -173,12 +161,9 @@
Property Optional? Description
maven.cruisecontrol.configYes + Config file to update/create. + Default value is ${maven.build.dir}/cruisecontrol/config.xml. +
maven.cruisecontrol.home No -

Location of cruise control installation - for finding the reporting directory

-

- NOTE: It may be more appropriate to set this in build.properties - on the CruiseControl server since the value may differ from developer to developer. -

+ Location where CC is installed. No default value.
maven.cruisecontrol.schedule.typemaven.cruisecontrol.work.dir Yes -

Defines the schedule type: interval or time. Default value is - interval.

-
maven.cruisecontrol.schedule.intervalYes -

Seconds in between builds for this project. Default value is - 300.

-
maven.cruisecontrol.schedule.timeYes -

Time when builds this project, in the form HHmm (execute every day). Default value is - 1900.

+ Location of the CC work directory that will be used at runtime. + Default value is ${maven.cruisecontrol.build.dir}.
maven.cruisecontrol.checkout.dir Yes -

Where to checkout/update code temporarily. Default value is - ${basedir}/checkout.

-

- NOTE: It may be more appropriate to set this in build.properties - on the CruiseControl server since the value may differ from developer to developer. -

-
maven.cruisecontrol.logs.encodingtypeYes -

Encoding type for logs files. Default value is - ISO-8859-1.

+ Location where to checkout/update code at runtime. + Default value is ${maven.cruisecontrol.work.dir}/checkout.
maven.cruisecontrol.logs.dir Yes -

Default value is - ${maven.build.dir}/cc-logs.

-

- NOTE: It may be more appropriate to set this in build.properties - on the CruiseControl server since the value may differ from developer to developer. -

+ Location where CC logs will be generated at runtime. + Default value is ${maven.cruisecontrol.work.dir}/logs +
maven.cruisecontrol.schedule.typeYes + Defines the schedule type: interval or time. + Default value is interval. +
maven.cruisecontrol.schedule.intervalYes + Seconds in between builds for this project. + Default value is 300. +
maven.cruisecontrol.schedule.timeYes + Time when builds this project, in the form HHmm (execute every day). + Default value is 1900. +
maven.cruisecontrol.logs.encodingtypeYes + Encoding type for logs files. + Default value is ISO-8859-1.
maven.cruisecontrol.logs.merge Yes -

Set true if you want to add others reports files at the end of the Cruisecontrol report file. Default value is - true.

+ Set true if you want to add others reports files at the end of the + Cruisecontrol report file. + Default value is true.
maven.cruisecontrol.logs.mergedirectory Yes -

Directory containing .xml reports files to merge. Default value is - ${maven.cruisecontrol.checkout.dir}/${module}/target/test-reports.

+ Directory containing .xml reports files to merge. + Default value is + ${maven.cruisecontrol.checkout.dir}/${module}/[maven.build.dir relative location]/test-reports.
maven.cruisecontrol.currentbuildstatus.filename Yes -

The filename to write the currentbuildstatus. Default value is - currentbuildstatus.txt.

+ The filename to write the current build status. + Default value is status.txt.
maven.cruisecontrol.goals Yes -

Default value is - scm:update-project|clean test|site:deploy.

-
maven.cruisecontrol.configYes -

Config file to update/create. Default value is - ${basedir}/cruisecontrol.xml.

-

- NOTE: It may be more appropriate to set this in build.properties - on the CruiseControl server since the value may differ from developer to developer. -

+ Default value is + scm:update-project|clean test|site:deploy.
maven.cruisecontrol.template Yes -

Template file to use in generating the cruisecontrol.xml file.

-

- NOTE: It may be more appropriate to set this in build.properties - on the CruiseControl server since the value may differ from developer to developer. -

+ Template file to use in generating the cruisecontrol.xml file.
maven.cruisecontrol.trigger.projects Yes + A comma separated list of projects that should trigger this project + to build when they are built. Allows you to build a project whose + dependencies have changed.

- A comma separated list of projects that should trigger this project to build when - they are built. Allows you to build a project whose dependencies - have changed. -

-

- NOTE: You may need to edit the config file to ensure that dependent - project appear prior to the project. This is because CruiseControl builds projects in - the order that appear in the config file. Failure to order the project properly may - results in continuious rebuilding of project and/or avoidable build failures. + NOTE: You may need to edit the config file to ensure that dependent + project appear prior to the project. This is because CruiseControl builds projects in + the order that appear in the config file. Failure to order the project properly may + results in continuious rebuilding of project and/or avoidable build failures.

maven.cruisecontrol.buildresults.site Yes -

- The root of the cruisecontrol site used in generating the link to - CruiseControl. By default this is - ${pom.url}/cruisecontrol. While not required, - typically you will need to set this. -

+ The root of the cruisecontrol site used in generating the link to CC + Default value is ${pom.url}/cruisecontrol. While not required, + typically you will need to set this.