L29 Build Management Ch13lect2
L29 Build Management Ch13lect2
Build Management
Outline of the Lecture
• 1950:
• Execution of a sequence of commands
• Job command language scripts
• 1970s: make
• Unix tool to support builds with makefiles
• 1990s: Ant
• Open source platform independent build tool
• 2000s: Maven
• Project management and integrated build tool
Example: Build Management in Unix
<project default="hello">
<target name="hello">
<echo message="Hello, World"/>
</target>
</project>
% ant
Buildfile: build.xml
hello: [echo] Hello, World
Execution BUILD SUCCESSFUL
of build file: Total time: 2 seconds
Maven Overview
• Maven is able to
• Receive developer artifacts from the programmers’
SCM directory
• Compile and package the source code
• Download dependent artifacts from another (external)
repository
• Generate Javadoc websites
• Generate developer and code metrics
• Generate websites containing status information to
track issues
• Deploy the compiled source code and the generated
website to a webserver
Modeling a Project in Maven
Project Object Model (POM)
• Project name, id, description, version number
• Website URL
• Issue tracking URL
• Mailing list URLs
• SCM directory URL
• Developer information
• License information
• Dependencies
• Name, version, location of a Java library from jar file
• Project directory layout
• Specifies source code and unit test code directories
Modeling a Project in Maven (UML)
<repository>
<connection>
scm|svn|http|//oose.globalse.org/svn/trunk/examples/arena
</connection>
<developerConnection>
scm|svn|http|//oose.globalse.org/svn
</developerConnection>
<url>
http://oose.globalse.org/svn/trunk/examples/arena/
</url>
</repository>
Generated Website:
Developer Activities (last 30 days)
Generated Website:
Change Log (last 30 days)
Build Management in the project.xml
• Functions:
• Set up scheduling strategy (poll, event-based)
• Detect change
• Execute build script when change has been detected
• Run unit test cases
• Generate project status metrics
• Visualize status of the projects
• Move successful builds into Software repository
• Components (Subsystems)
• Master Directory: Version control (IEEE: Controlled Library).
• Builder Subsystem: Execute build script when a change has been
detected
• Continuous Integration (CI) Server
• Management Subsystem: Visualize project status via Webbrowser
• Notification Subsystem: Publishes results of the build via different
channels (E-Mail Client, RSS Feed)
Analysis: Functional Model for Continuous
Integration
• Development Node
• Manage Programmer’s Directory (IEEE: Dynamic Library)
• Software Configuration Management client
• Integrated Development Environment
• Run build script locally using the Builder Subsystem
Design of a Continuous Integration System
(Deployment Diagram)
• Management Node
• Visualize build results
• Visualize project metrics
• Receive notification about build status
Examples of Available
Continous Integration Systems
• Cockpit
• CruiseControl and CruiseControl.NET
• Anthill
• Continuum
• Hudson
Source: http://cruisecontrol.sourceforge.net/overview.html
Cruise Control: The Build Loop
Ant binaries
Build artifacts
Log files
Files needed for
Projects to be operation
build
CruiseControl Directory Layout II
Project folders
Timestamp named
folders for build artifacts
Project artifacts of a
specific build
CruiseControl Webpages
http://localhost:8080/cruisecontrol/
CruiseControl Webpages
http://localhost:8080/dashboard/
Getting Started with CruiseControl
• http://ant.apache.org
• http://codefeed.com/tutorial/ant_intro.html
• http://blog.ideoplex.com/software/java/
• http://www.iseran.com/Java/ant/tutorial/
ant_tutorial.html
• http://www.javaworld.com/javaworld/jw-10-
2000/jw-1020-ant.html
Maven References
• http://maven.apache.org/
• http://www.sandcastsoftware.com/
articlesandtutorials/index.html
• http://www-106.ibm.com/developerworks/java/
library/j-maven/
• http://www.jpox.org/docs/1_1/tutorials/
maven.html
Further Reading
[Duvall 2007]
• Paul M. Duvall, Steve Matyas and Andrew Glover:
Continuous Integration. Improving Software Quality
and Reducing Risk, Addison Wesley, Upper Saddle
River, NJ, 2007
Tomorrow’s Exercise
• Goal: Being able to set up and manage continuous integration
• Team-based organization: The exercise is team-based
• We recommend a team size of 5 people (4-6)
• Choose a team leader
• Equipment:
• Bring at least 2 laptops per team to the class room
• Preparations (Mandatory, by midnight)
• E-Mail the team member names to [email protected]
• Set up Eclipse on at least one of the team laptops
• Check out and study the Bumpers project using the information
available on the exercise portal :
https://wwwbruegge.informatik.tu-muenchen.de/twiki/bin/view/Le
hrstuhl/POMSS09Exercises
• Additional details
• Will be distributed at the beginning of the exercise session.
Deployment in tomorrows exercise
Backup Slides
Examples of concrete Ant Tasks
compile:
[mkdir] Created dir: /Users/wolft/Asteroids/classes
[javac] Compiling 12 source files to
/Users/wolft/Asteroids/classes
[copy] Copying 6 files to
/Users/wolft/Asteroids/classes/org/globalse/oose/asteroids
BUILD SUCCESSFUL
Total time: 6 seconds
Another Ant Example (3)
% ant jar
Buildfile: build.xml
compile:
jar:
[jar] Building jar: /Users/wolft/Asteroids/Asteroids.jar
BUILD SUCCESSFUL
Total time: 2 seconds