• Like
Maven 2 - more than a build tool
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Maven 2 - more than a build tool

  • 494 views
Published

Maven is basically a system for compiling code, packing code and publishing packed code, but the flexibility of plugins allows it to carry out a wide selection of tasks. Most often, these tasks are …

Maven is basically a system for compiling code, packing code and publishing packed code, but the flexibility of plugins allows it to carry out a wide selection of tasks. Most often, these tasks are very developer-centric, assisting in the development- and deployment process. We have successfully implemented a plugin that extend the build system to also handle configuration management of various test-environments, nightly deployment of new versions from CI with a single parameter and easy, centrally controlled configuration of developers environments.
Even though the implementation is bound to our choice of infrastructure, the ideas and experiences should apply to a wide range of configurations.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
494
On SlideShare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Maven - more than a build tool Using Maven for automated configuration management and deployment Harald Søvik Sr. Knowledge Engineer, Computas AS
  • 2. Agenda
    • Goal and objectives
    • Infrastructure
      • Configure the AS
      • Deploy to AS
      • Manage AS lifecycle
    • Drawbacks
    • Future
  • 3. Pragma:
    • “ The software” is
      • code and build code
      • checked out from your VCS
      • that can be assembled
      • in a repeatable manner
      • and deployed to an application server
  • 4.
    • Strategical goal:
      • Automate manual, labourous tasks to reduce time spent on non-productive work in a software development project.
    • Tactical goal:
      • Automate configuration management of a system installation on a remote or local host.
      • Automate deployment of any version of the software to a defined envionment.
      • Automate the life cycle of application servers
  • 5.
    • Objective :
      • 3-tier application: db, ejb-server and client + webserver.
      • De- and configure a existing JBoss installation. Client installation. No database intervention.
      • (Could have been installation of baseline datbase, patching with changes, validation of views/procedures/functions)
      • Multiple software branches: maintenance of production code, development of next major release, maybe a separate branch for a major change (should require no major reconfiguration)
      • Multiple stageing envrionments: development, test, systems/customer representative test, acceptance test.
  • 6. Agenda
    • Goal and objectives
    • Infrastructure
      • Configure the AS
      • Deploy to AS
      • Manage AS lifecycle
    • Drawbacks
    • Future
  • 7.
    • Step 1: Environmental configuration in build system
      • Maven POM contains properties and profiles. Profiles lets you select and possibly override a set of properties. And there is always the default profile.
      • The POM is under version control, and can be modified across branches.
      • Thus: profiles can correspond to "physical" environments, and let each profile have a set of hosts involved.
    VCS VCS VCS Branch A pom.xml Branch A profile test: - host a - host b VCS VCS Branch A pom.xml Branch A VCS VCS Branch A pom.xml Branch A profile test: - ejb host A - web host B VCS VCS Branch A pom.xml v3.0 VCS VCS Branch A pom.xml Branch A profile test: - host a - host b VCS VCS Branch A pom.xml Branch A VCS VCS Branch A pom.xml Branch A profile test: - ejb host X - web host Y VCS VCS Branch A pom.xml v4.0
  • 8. The default profile: localhost. <profile> <id>default</id> <properties> <ejbServer>localhost</ejbServer> <webServer>localhost</webServer> <clientHost>localhost</clientHost> <jbossHome>${JBOSS_HOME}</jbossHome> </properties> </profile>
  • 9. An example profile: <profile> <id>test</id> <properties> <ejbServer>vm-utst3jb01</ejbServer> <webServer>vm-utst3jbweb01</webServer> <clientHost>ustts02</clientHost> <jbossHome>/usr/local/java/jboss</jbossHome> </properties> </profile>
  • 10. Runtime configuration
    • Ad-hoc configuration can be defined run-time:
    • mvn
      • clean install
      • -Ptest
      • -DejbServer=vm-utst4jb01
      • -DwebServer=vm-utst2jbweb01
  • 11.
    • Configuration of AS
    • Now, when the hosts are known, they can be configured.
      • Remove previous configuration files and unneccessary files (whitelist/blacklist)
      • Copy libraries and configuration files
      • Each host has a folder in VCS where config and libs are stored as files
      • Clean the installation. Remove temporary files and serialized data. Remove prevous deployments.
    <ejbDeleteFiles> <string> deploy/hsqldb-ds.xml </string> <string> conf/jbossmq.xml </string> </ejbDeleteFiles> 3.0/ conf/ vm-utv3jb01/ JBoss/ lib/ itext.jar jasper.jar conf/ ojdbc-ds.xml log4j.xml
  • 12.
    • Stop and start the AS
      • invoke the native start/stop script via java runtime
      • requires some AS-dependent knowledge
      • automated deployments must work: kill -9 if neccessary.
    ssh <host> sudo /etc/init.d/jboss stop // read output stream and assert result // sleep ssh <host> ps -ef // read output and check status // possibly: ssh <host> kill <pid> ssh <host> kill -9 <pid>
  • 13.
    • Deployment
      • copy the application file to the application server
      • locally, you can use java.io
      • scp to a remote server (but requires stuff beyond maven)
      • optionally
        • scp in java
        • integrate with AS hot deploy
  • 14. CI lifecycle Update from ci <scheduled> Build, package Stop the AS Clean, configure Deploy to AS Start the AS Deploy client Assert status
  • 15. Agenda
    • Goal and objectives
    • Infrastructure
      • Configure the AS
      • Deploy to AS
      • Manage AS lifecycle
    • Drawbacks
    • Future
  • 16.
    • Drawbacks :
      • developers become oblivious to AS configuration/deployment
      • very generic - has few shortcuts
      • somewhat time consuming, but good for CI
      • already implemented by i.e. oracle grid control
  • 17. Agenda
    • Goal and objectives
    • Infrastructure
      • Configure the AS
      • Deploy to AS
      • Manage AS lifecycle
    • Drawbacks
    • Future
  • 18.
    • Future:
      • short term
        • use in other projects
        • make available as open source
        • doc
        • remove dependencies on external tools
      • long term
        • must support multiple arcitectures
        • must support multiple application servers
  • 19. Summary
    • Simple, tool for configuration management
    • Easy to implement new requirements
    • Quick tool for developers
  • 20. For More Information
    • [email_address]
    • http://www.computas.com
  • 21. Maven – more than a build tool Harald Søvik [email_address] Using Maven for automated configuration management and deployment