maven project automation for dummies l.
Skip this Video
Loading SlideShow in 5 Seconds..
Maven project automation for dummies PowerPoint Presentation
Download Presentation
Maven project automation for dummies

Loading in 2 Seconds...

play fullscreen
1 / 55

Maven project automation for dummies - PowerPoint PPT Presentation

  • Uploaded on

Maven project automation for dummies. Aino Andriessen AMIS. Continuous Integration. Continuous integration is the practice where the work of all the developers are integrated, analyzed and verified on a regular basis, preferably multiple times a day.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Maven project automation for dummies' - amadeus

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
continuous integration
Continuous Integration

Continuous integration is the practice where the work of all the developers are integrated, analyzed and verified on a regular basis, preferably multiple times a day.

It takes the latest situation from the source control system, performs unit tests, makes a build, deploys the application, performs integration tests and creates reports about these steps and communicates them with the team, all automatically without human interaction.

  • Infrastructure
  • Scripting
  • No IDE
  • Maven
  • ant
  • make
  • shell scripts
  • sql scripts
  • ...
maven execution info
Maven execution info

[INFO] Scanning for projects...

[INFO] Reactor build order:


[INFO] HR1 model

[INFO] HR1 viewController

[INFO] HR1 ear

[INFO] HR1 integration

[INFO] -------------------------


118K downloaded


[INFO] ------------------------------------------------------------------------

[INFO] Reactor Summary:

[INFO] ------------------------------------------------------------------------

[INFO] HR1 ................................................... SUCCESS [3.003s]

[INFO] HR1 model ............................................. SUCCESS [7.866s]

[INFO] HR1 viewController .................................... SUCCESS [54.451s]

[INFO] HR1 ear ............................................... SUCCESS [14.591s]

[INFO] HR1 integration ....................................... SUCCESS [0.312s]

[INFO] ------------------------------------------------------------------------

[INFO] ------------------------------------------------------------------------


[INFO] ------------------------------------------------------------------------

[INFO] Total time: 1 minute 20 seconds

[INFO] Finished at: Fri Jun 01 17:32:01 CEST 2007

[INFO] Final Memory: 10M/18M

[INFO] ------------------------------------------------------------------------

mvn test
mvn test

[INFO] [surefire:test]

[INFO] Surefire report directory: D:\projects\myprojects\odtugDemo\hr1\model\tar





Running nl.amis.demo.odtug.model.queries.OdtugTstViewTest

Jun 1, 2007 7:04:22 PM oracle.adf.share.config.ADFConfigFactory findOrCreateADFC


INFO: oracle.adf.share.config.ADFConfigFactory No META-INF/adf-config.xml found

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.606 sec

Running nl.amis.demo.odtug.model.queries.RegionsViewTest

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec

Running nl.amis.adf.fwk.test.Java5Test

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 sec

Running nl.amis.demo.odtug.model.queries.JobsViewTest

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.046 sec

Running nl.amis.demo.odtug.model.queries.EmployeesViewTest

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.032 sec

Running nl.amis.demo.odtug.model.queries.DepartmentsViewTest

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 sec

Running nl.amis.demo.odtug.model.queries.LocationsViewTest

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 sec

Running nl.amis.demo.odtug.model.queries.CountriesViewTest

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 sec

Results :

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

mvn package
mvn package

[INFO] Building HR1

[INFO] task-segment: [package]

[INFO] ---------------------------

[INFO] [jar:jar]

[INFO] Building jar: D:\projects\myprojects\odtugDemo\hr1\model\target\hr1-model-1.0-SNAPSHOT.jar

[INFO] -------------------------------------------------------------------------

[INFO] [war:war]

[INFO] Building war: D:\projects\myprojects\odtugDemo\hr1\viewController\target\hr1-viewController-1.0-SNAPSHOT.war

[INFO] [ear:ear]

[INFO] Copying artifact[war:nl.amis.demo.odtug.hr1:hr1-viewController:1.0-SNAPSHOT] to[hr1-viewController-1.0-SNAPSHOT.war]

[INFO] Copying artifact[jar:log4j:log4j:1.2.12] to[log4j-1.2.12.jar]

[INFO] Copying artifact[jar:commons-logging:commons-logging:1.0.4] to[commons-logging-1.0.4.jar]

[INFO] Could not find manifest file: D:\projects\myprojects\odtugDemo\hr1\ear\src\main\application\META-INF\MANIFEST.MF - Generating one

[INFO] Building jar: D:\projects\myprojects\odtugDemo\hr1\ear\target\hr1-ear-1.0-SNAPSHOT.ear

[INFO] -------------------------------------------------------------------------

mvn exec exec plocaloc4j
mvn exec:exec -PlocalOC4J

[INFO] [exec:exec]

[[INFO] 07/06/01 17:21:22 Notification ==>Uploading file hr1.ear ...


[INFO] 07/06/01 17:21:22 Notification ==>Application Deployer for hr1 STARTS.


[INFO] 07/06/01 17:21:22 Notification ==>Copy the archive to :\server\oc4j_101310\j2ee\home\applications\hr1.ear


[INFO] 07/06/01 17:21:22 Notification ==>Initialize C:\server\oc4j_101310\j2ee\home\applications\hr1.ear begins...


[INFO] 07/06/01 17:21:24 Notification ==>Initialize hr1-viewController-1.0-SNAPSHOT begins...


[INFO] 07/06/01 17:21:24 Notification ==>Initialize hr1-viewController-1.0-SNAPSHOT ends...


[INFO] 07/06/01 17:21:24 Notification ==>Started application : hr1


[INFO] 07/06/01 17:21:24 Notification ==>Binding web application(s) to site default-web-site begins...


[INFO] 07/06/01 17:21:24 Notification ==>Binding hr1-viewController-1.0-SNAPSHOT web-module for application hr1 to site default-web-site under context root /hr1


[INFO] 07/06/01 17:21:31 Notification ==>Initializing Servlet: javax.faces.webapp.FacesServlet for web application hr1-viewController-1.0-SNAPSHOT


[INFO] 07/06/01 17:21:31 Notification ==>Binding web application(s) to site default-web-site ends...


[INFO] 07/06/01 17:21:31 Notification ==>Application Deployer for hr1 COMPLETES.

Operation time: 8273 msecs

mvn deploy
mvn deploy

[INFO] [deploy:deploy]

[INFO] Retrieving previous build number from ATAMaven2SnapshotsRepo

Uploading: file:\\amis-test-aa\maven2snapshots/nl/amis/demo/odtug/hr1/hr1-model/1.0-SNAPSHOT/hr1-model-1.0-20070601.171522-4.jar

50K uploaded

[INFO] Retrieving previous metadata from ATAMaven2SnapshotsRepo

[INFO] Uploading repository metadata for: 'snapshot nl.amis.demo.odtug.hr1:hr1-model:1.0-SNAPSHOT'

[INFO] -------------------------------------------------------------------------

demo summary
Demo Summary
  • ADF Faces application
  • Tasks
    • Unittesting
    • Make a build
    • Deploy ear file to OC4J
    • Perform integrationtests
    • Share artifacts
    • Share information
  • Without manual intervention and JDeveloper !
software development
Software development
  • The development environment
  • Source control
  • Delivery environments
  • Issue management
  • Library management
  • Build automation / continuous integration
  • Reporting and documentation
  • Communication
nightly build
Nightly build
  • Continuum
    • Scheduler

Project Object Model

    • Project objects
    • xml file

Build Lifecycle

    • actions / goals (tasks)
  • Dependency (library, artifact) Management
  • Reporting and Documentation
  • ...



pom example
POM example













<description>This application manages employees and general company information.</description>



<name>AMIS Services</name>







pom example23
POM example












<name>Aino Andriessen</name>













pom example24
Pom Example



























build lifecycle
Build Lifecycle
  • Organized sequence of phases like compile, test, package, build etc. The actual work is done by goals which are bound to a certain phase.
  • Configuration (if necessary) in pom
  • Other lifecycles
    • clean
    • site
  • mvn compile
    • mvn compile:compile
    • mvn compile:test-compile
  • mvn package
    • mvn jar
      • mvn jar:jar
      • mvn jar:sign
      • mvn test-jar:jar
  • All 'tasks' are plugins
  • Written in java, ant
dependency management
Dependency Management
  • Defined in the POM
  • Downloaded from repository when needed
  • Stored in local repository




















maven repositories 2
Maven repositories 2
  • Local
  • Internal
  • Central
  • External
    • Codehaus
    • ...
internal repository
Internal repository
  • commercial libraries
  • non-public libraries
  • company products
amis internal repositories
AMIS internal repositories
  • Upload the (created) artifact to the internal repository
  • mvn deploy:deploy-file
    • deploy a library tot the repository

call mvn deploy:deploy-file







  • Dependency management for development 'releases'.
  • Unittests
    • JUnit
    • TestNG
  • Integration tests
  • Database tests
  • ...
integration tests
Integration tests
  • Start application server
  • Prepare the database
  • Deploy application
  • Run tests
  • Undeploy application
  • Stop application server
integration tests37
Integration tests
  • Front-end
    • Selenium
    • JMeter
  • Back-end / Database
    • QCTO
    • utPLSQL
  • Tools
    • dbunit
    • Maven sql plugin
    • Maven exec plugin
    • (JDeveloper) ant tasks
  • mvn release:prepare
    • update version
    • tag in scm
  • mvn release:perform
    • deploy tagged version
      • artifact
      • sources
      • doc
    • create and deploy file
maven projectsites
Maven projectsites
  • Documentation
  • Project info
  • Reports
maven bits and pieces
Maven 'bits and pieces'
  • Reports
  • Profiles
  • Archetype
  • Cargo plugin
  • Multi module projects
  • ...
mavenize an adf application
Mavenize an ADF application
  • Dependency management
  • Crete or generate POM files
  • Tools
  • admin_client.jar utility
    • deployment to OC4J
  • ojspc.jar utility
    • pre compilation of jsf files
  • [JDeveloper]
  • [oc4j]
jdeveloper library management
JDeveloper library management
  • JDeveloper has a great library management system...
    • as long as you stay in JDeveloper
    • as long as you use the provided libraries
  • Put (deploy) libraries in the internal repository
  • Keep pom file(s) in sync

call mvn deploy:deploy-file















required libraries
Required libraries
  • ADF
      • adfshare, adfui, adf-controller, adfbinding, adfm, bc4jdomorcl, bc4jmt, bc4jct, bc4jdatum, bc4jhtml, datatags, graphtags, bc4jimdomains, ordim
      • jhsadfrt, sqlj runtime
  • JDeveloper
      • oc4j-internal, oc4j, adf-faces-impl, adf-faces-api, jdev-cm, ojmisc, xmlparserv2, ojsp, ojsputil
  • Other
      • sun collections 1.1, apache commons
  • Note : do NOT include log4j
application project organisation
Application / Project organisation
  • Directory layout
    • Default Maven layout
    • JDev project settings
  • Application with multiple projects
adf archetype
ADF Archetype
  • AMIS maven-archetype-adf :

mvn archetype:create







projectfile generation
Projectfile generation
  • Create jws and jpr files
  • myFaces - Trinidad JDev plugin
    • org.apache.myfaces.trinidadbuild.maven-jdev-plugin
    • version 1.2.5
  • Execute : mvn jdev:jdev
deploy to oc4j
Deploy to OC4J
  • Command-line
  • oc4j admin_client.jar utility
  • in ear project or associated with a certain phase
    • mvn exec:exec -PlocalOC4J
  • Unfortunately no Cargo plugin
    • cargo:start, cargo:stop, cargo:deploy
  • Define local dependencies (location of admin_client.jar) in local settings.xml











































java -jar C:\server\oc4j_101310\j2ee\home\admin_client.jar


oc4jadmin oc4jadmin

-deploy -file hr1-ear-1.0-SNAPSHOT.ear

-deploymentName hr1 -bindAllWebApps

running maven from jdeveloper
Running Maven from JDeveloper
  • Waiting for a JDeveloper extension ;-)
  • Ant tasks as wrapper
installation of maven
Installation of Maven
  • Unzip
  • Environment settings : M2_HOME , PATH
    • mvn -verify
  • settings.xml
    • <M2_HOME>/conf/ or <user.dir>/.m2/
    • [local repository]
    • servers
      • credentials
    • internal repositories
    • local configurations
      • oc4j installation
  • Continuous integration is essential for the development process!
  • Using Maven, ADF Faces applications can be continuously integrated!
  • Maven succesfully applied at Connexys, Pagoni, Locatus, Nieuw Caledonië