How do I schedule how often Continuum attempts to build a project?
Author: Deron Eriksson
Description: This tutorial describes how to set a schedule for how often Continuum attempts to build a project.
Tutorial created using: Windows Vista || JDK 1.6.0_04 || Eclipse Web Tools Platform 2.0.1 (Eclipse 3.3.1)


Page: < 1 2

(Continued from page 1)

To test things, I'll 'break' my project. I insert some crappy code into the Howdy class and commit it.

Committing bad code

I commit the Howdy.java file, checking it into my SCM system (CVSNT).

Committing bad code

In a few minutes, I check on the "aproject" project in ContinuumW. We can see that Continuum detected the change in the project in the version control system and attempted to build it. We can see that the build failed.

Build failed

If we check on the Continuum build results for the "aproject" project, we can see that the build failed due to the bad code that I checked in.

Continuum build results for 'aproject' project

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building aproject
[INFO]    task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory C:\dev\apache-continuum-1.1\apps\continuum\webapp\WEB-INF\working-directory\6\target
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 2 source files to C:\dev\apache-continuum-1.1\apps\continuum\webapp\WEB-INF\working-directory\6\target\classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

C:\dev\apache-continuum-1.1\apps\continuum\webapp\WEB-INF\working-directory\6\src\main\java\com\maventest\Howdy.java:[11,2] not a statement

C:\dev\apache-continuum-1.1\apps\continuum\webapp\WEB-INF\working-directory\6\src\main\java\com\maventest\Howdy.java:[11,8] ';' expected


[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Feb 26 00:50:05 PST 2008
[INFO] Final Memory: 5M/10M
[INFO] ------------------------------------------------------------------------

Just so that we don't end with a broken project, let's fix the Howdy class and check in the code.

Code fixed and checked in

After making this fix, Continuum will attempt to build the project according to the EVERY_10 schedule that we created, so it will try to build the project at the next 10 minute interval. This happens, and we can see from the status that the project build successfully.

Project build successfully

The successful build results are shown here.

Continuum build results for 'aproject' project

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building aproject
[INFO]    task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory C:\dev\apache-continuum-1.1\apps\continuum\webapp\WEB-INF\working-directory\6\target
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 2 source files to C:\dev\apache-continuum-1.1\apps\continuum\webapp\WEB-INF\working-directory\6\target\classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Compiling 2 source files to C:\dev\apache-continuum-1.1\apps\continuum\webapp\WEB-INF\working-directory\6\target\test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory: C:\dev\apache-continuum-1.1\apps\continuum\webapp\WEB-INF\working-directory\6\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.maventest.AppTest
Hello World!
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.044 sec
Running com.maventest.HowdyTest
Howdy says hello!
Howdy says hello!
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 sec

Results :

Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO] [jar:jar]
[INFO] Building jar: C:\dev\apache-continuum-1.1\apps\continuum\webapp\WEB-INF\working-directory\6\target\aproject-1.0-SNAPSHOT.jar
[INFO] [install:install]
[INFO] Installing C:\dev\apache-continuum-1.1\apps\continuum\webapp\WEB-INF\working-directory\6\target\aproject-1.0-SNAPSHOT.jar to \dev\m2repo\com\maventest\aproject\1.0-SNAPSHOT\aproject-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Tue Feb 26 01:00:09 PST 2008
[INFO] Final Memory: 12M/22M
[INFO] ------------------------------------------------------------------------

In this tutorial we've seen how we can create a schedule in Continuum and how we can associate that schedule with a project to govern the times at which Continuum looks to build the project.

Page: < 1 2