1 may 31, 2007 Build, test and deploy ADF applications without effort with the use of Maven2 Aino Andriessen AMIS.

Slides:



Advertisements
Similar presentations
Vincent Massol, 1 st December 2006 Quality with Maven2.
Advertisements

Apache Maven: J2EE Front to Back Jesse McConnell -
Introduction to Maven 2.0 An open source build tool for Enterprise Java projects Mahen Goonewardene.
Developing in CAS. Why? As distributed you edit CAS 3 with Eclipse and build with Maven 2 – Best Practice for Release Engineering – Difficult edit-debug.
Introduction to Maven Michael Youngstrom. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to the Java Stack.
Functional Testing with the Java Stack Test Runner
Java Build Tool Comparison HJUG - April 29th, 2009 John Tyler.
Maven 2.0 Project management and comprehension tool.
Java development infrastructure at FMI Pekka Rantala FMI.
Maven: Build and project management in the 21th century.
Intermediate Maven Michael Youngstrom. Notes This is a training NOT a presentation Please ask questions No making fun of my microphone Prerequisites –
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado.
Maven and Stack Starter Michael Youngstrom. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack.
Using Maven2. Free Maven Books Maven: The Definitive Guide (alpha)‏ Better Builds with Maven
Maven & Bamboo CONTINUOUS INTEGRATION. QA in a large organization In a large organization that manages over 100 applications and over 20 developers, implementing.
MAVEN-BLUEMARTINI Yannick Robin. What is maven-bluemartini?  maven-bluemartini is Maven archetypes for Blue Martini projects  Open source project on.
Sumedha Rubasinghe October,2009 Introduction to Programming Tools.
LDS Account Integration. Disclaimer This is a training NOT a presentation. – Be prepared to learn and participate in labs Please ask questions Prerequisites:
AUTOBUILD Build and Deployment Automation Solution.
|Tecnologie Web L-A Anno Accademico Laboratorio di Tecnologie Web Introduzione ad Eclipse e Tomcat
Using the ALM Module Fully Automated Deployments in Stack 3.2.
INFSOM-RI Juelich, 10 June 2008 ETICS - Maven From competition, to collaboration.
Juggling Java EE with Enterprise Apache Maven Jesse McConnell -
Microsoft SharePoint Server 2010 for the Microsoft ASP.NET Developer Yaroslav Pentsarskyy
Using the ALM Module Michael Youngstrom. Disclaimer This is a training NOT a presentation. – Be prepared to learn and participate in lab Please ask questions.
LDS Account Integration. Disclaimer This is a training NOT a presentation. – Be prepared to learn and participate in labs Please ask questions Prerequisites:
1 dec 20, 2007 Maven project automation for dummies Aino Andriessen AMIS.
Module 8 : Configuration II Jong S. Bok
Confidential Continuous Integration Framework (CIF) 5/18/2004.
14th Oct 2005CERN AB Controls Development Process of Accelerator Controls Software G.Kruk L.Mestre, V.Paris, S.Oglaza, V. Baggiolini, E.Roux and Application.
Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install.
Introduction to Maven 2. Basics Convention over Configuration Declarative project management DRY.
Maven 2.0 Improve your build patterns Vincent Massol CTO Pivolis.
Maven for building Java applications By Nalin De Zoysa
Enterprise Java v090125Dev Env Overview1 Enterprise Java ( ) Development Environment Overview.
Spring-Batch Tutorial Getting Started Guide. Agenda  Software prerequisites  Creating new batch application  Setting up database  Running a job.
Maven, Eclipse and OSGi working together Carlos Sanchez March 17, 2008.
Ant / continuous integration. Turning Client Vision into Results 2 Outline presentation Introduction Ant –History –Concepts –Tasks –Examples –Extending.
All the dSoftArk Tools Getting started!. Tools dSoftArk is a semi-realistic, agile, development project –Industrial strength software (programming, TDD,
17 Copyright © 2004, Oracle. All rights reserved. Deploying an ADF Application.
Managing your builds with Maven 2 Craig Walls LoneStar Software Symposium 2007
Software Deployment & Release 26/03/2015 1EN-ICE.
8/29/10 Maven Repository Management with Nexus Jim McMahon.
JRA1 Meeting – 09/02/ Software Configuration Management and Integration EGEE is proposed as a project funded by the European Union under contract.
Maven. Introduction Using Maven (I) – Installing the Maven plugin for Eclipse – Creating a Maven Project – Building the Project Understanding the POM.
CS520 Web Programming Introduction to Maven Chengyu Sun California State University, Los Angeles.
Exploring Maven 2 Craig Walls Gateway Software Symposium 2007 Blog: Wiki: Examples:
Maven & NetBeans Platform. Agenda ● Maven NetBeans Platform Project Types ● Three NetBeans RCP project types ● Differences with Ant project types ● All.
Platform & Maven2 David Šimonek. Certified Engineer Course Agenda What is Maven? Why Maven? NB IDE & Maven NB Platform & Maven.
Agenda:- DevOps Tools Chef Jenkins Puppet Apache Ant Apache Maven Logstash Docker New Relic Gradle Git.
Unit Testing.
with Some Eclipse Tricks included Safa Bacanlı Fall 16
Maven 04 March
CS520 Web Programming Introduction to Maven
Build Automation with Gradle
Plan What is Maven ? Links : mvn command line tool
Test Driven Development
prepared by hasan.we4tech.com
Project management and comprehension tool
Advanced Integration and Deployment Techniques
Maven IIB9 Plug-in Version 9.0
With Some Eclipse Tricks included.
Maven IIB9 Plug-in Version 9.0
Continuous Integration Tool
Escidoc build and development environment
Building LabKey with Gradle
Software Engineering and Architecture
Presentation transcript:

1 may 31, 2007 Build, test and deploy ADF applications without effort with the use of Maven2 Aino Andriessen AMIS

2 may 31, 2007 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.

3 may 31, 2007 Conditions Infrastructure Scripting No IDE

4 may 31, 2007 Scripting Maven ant make shell scripts sql scripts...

5 may 31, 2007 Demo

6 may 31, 2007 Maven execution info [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] HR1 [INFO] HR1 model [INFO] HR1 viewController [INFO] HR1 ear [INFO] HR1 integration [INFO] Downloading: 118K downloaded [INFO] [INFO] [INFO] Reactor Summary: [INFO] [INFO] HR 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] BUILD SUCCESSFUL [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]

7 may 31, 2007 mvn test [INFO] [surefire:test] [INFO] Surefire report directory: D:\projects\myprojects\odtugDemo\hr1\model\tar get\surefire-reports T E S T S Running nl.amis.demo.odtug.model.queries.OdtugTstViewTest Jun 1, :04:22 PM oracle.adf.share.config.ADFConfigFactory findOrCreateADFC onfig INFO: oracle.adf.share.config.ADFConfigFactory No META-INF/adf-config.xml found Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: sec Running nl.amis.demo.odtug.model.queries.RegionsViewTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: sec Running nl.amis.adf.fwk.test.Java5Test Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: sec Running nl.amis.demo.odtug.model.queries.JobsViewTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: sec Running nl.amis.demo.odtug.model.queries.EmployeesViewTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: sec Running nl.amis.demo.odtug.model.queries.DepartmentsViewTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: sec Running nl.amis.demo.odtug.model.queries.LocationsViewTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: sec Running nl.amis.demo.odtug.model.queries.CountriesViewTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: sec Results : Tests run: 8, Failures: 0, Errors: 0, Skipped: 0

8 may 31, 2007 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 jar] [INFO] Copying artifact[jar:commons-logging:commons-logging:1.0.4] to[commons-logging 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]

9 may 31, 2007 mvn exec:exec -PlocalOC4J [INFO] [exec:exec] [[INFO] 07/06/01 17:21:22 Notification ==>Uploading file hr1.ear... [INFO] [INFO] 07/06/01 17:21:22 Notification ==>Application Deployer for hr1 STARTS. [INFO] [INFO] 07/06/01 17:21:22 Notification ==>Copy the archive to :\server\oc4j_101310\j2ee\home\applications\hr1.ear [INFO] [INFO] 07/06/01 17:21:22 Notification ==>Initialize C:\server\oc4j_101310\j2ee\home\applications\hr1.ear begins... [INFO] [INFO] 07/06/01 17:21:24 Notification ==>Initialize hr1-viewController-1.0-SNAPSHOT begins... [INFO] [INFO] 07/06/01 17:21:24 Notification ==>Initialize hr1-viewController-1.0-SNAPSHOT ends... [INFO] [INFO] 07/06/01 17:21:24 Notification ==>Started application : hr1 [INFO] [INFO] 07/06/01 17:21:24 Notification ==>Binding web application(s) to site default-web-site begins... [INFO] [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] [INFO] 07/06/01 17:21:31 Notification ==>Initializing Servlet: javax.faces.webapp.FacesServlet for web application hr1-viewController-1.0-SNAPSHOT [INFO] [INFO] 07/06/01 17:21:31 Notification ==>Binding web application(s) to site default-web-site ends... [INFO] [INFO] 07/06/01 17:21:31 Notification ==>Application Deployer for hr1 COMPLETES. Operation time: 8273 msecs

10 may 31, 2007 mvn verify -PlocalOC4J

11 may 31, 2007 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 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]

12 may 31, 2007 mvn site

13 may 31, 2007 Build automation server

14 may 31, 2007 Demo Summary ADF Faces ( ) application Without JDeveloper :  Unittesting  Make a build  Deploy ear file to OC4J  Perform integrationtests  Share artifacts  Share information

15 may 31, 2007 Infrastructure

16 may 31, 2007 Software Studio

17 may 31, 2007 Software development The development environment Source control Delivery environments Issue management Library management Build automation / continuous integration Reporting and documentation Communication

18 may 31, 2007

19 may 31, 2007 Maven Convention over configuration Project Object Model  objects / things  xml file Build Lifecycle  actions / goals Dependency (library, artifact) Management

20 may 31, 2007 POM example nl.amis.demo.odtug.hr1 hr1 1.0-SNAPSHOT pom model viewController ear HR1 This application manages employees and general company information. AMIS Services Jira

21 may 31, 2007 POM example scm:svn: scm:svn: aino.andriessen Aino Andriessen AMIS developer +1 AMISMaven2Repo file:\\amis-test-aa\maven2

22 may 31, 2007 Pom Example org.apache.maven.plugins maven-compiler-plugin 1.6 org.apache.maven.plugins maven-checkstyle-plugin src/main/resources/amis_checkstyle.xml

23 may 31, 2007 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 validate generate-sources process-sources generate-resources process-resources compile process-classes generate-test-sources process-test-sources generate-test-resources process-test-resources test-compile test prepare-package package pre-integration-test integration-test post-integration-test verify install deploy

24 may 31, 2007 Execution mvn compile  mvn compile:compile  mvn compile:test-compile mvn jar  mvn jar:jar  mvn jar:sign  mvn test-jar:jar

25 may 31, 2007 Dependency Management Defined in the POM Downloaded from repository when needed Stored in local repository junit test com.oracle.adf adfbinding provided nl.amis.demo.odtug.hr1 hr1-model ${project.version}

26 may 31, 2007 Maven repositories

27 may 31, 2007 Maven repositories 2 Local Internal Central  External  Codehaus  java.net ...

28 may 31, 2007 Internal repository commercial libraries non-public libraries company products call mvn deploy:deploy-file -DgroupId=com.oracle.jdbc -DartifactId=ojdbc14 -Dversion= Dfile=ojdbc14.jar -Dpackaging=jar -DrepositoryId=AMISMaven2Repository -Durl=%MAVEN_REPO_URL%

29 may 31, 2007 Maven 'bits and pieces' Plugins Projectsite Reports Profiles Snapshots Release Archetype...

30 may 31, 2007 ADF & JDeveloper & Maven

31 may 31, 2007 Mavenize an ADF application Dependency management POM files Tools

32 may 31, 2007 Tools admin_client.jar utility ojspc.jar utility [JDeveloper] [oc4j]

33 may 31, 2007 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

34 may 31, 2007 JDeveloper library (mis)management - 2 Version management  JDeveloper version What is the impact of service updates?  OC4J version  ADF version External libraries management What if part of the application is developed in another IDE?

35 may 31, 2007 Library management

36 may 31, 2007 Dependencies Put (deploy) libraries in the internal repository Keep pom file(s) in sync com.oracle.adf adfshare provided

37 may 31, 2007 Required libraries ADF adfshare, adfui, adf-controller, adfbinding, adfm, bc4jdomorcl, bc4jmt, bc4jct, bc4jdatum, bc4jhtml, datatags, graphtags, bc4jimdomains, ordim JDeveloper oc4j-internal, oc4j, adf-faces-impl, adf-faces-api, jdev- cm, ojmisc, xmlparserv2, ojsp, ojsputil call mvn deploy:deploy-file -DgroupId=com.oracle.adf -DartifactId=adfshare -Dversion=%ADF_VERSION% -Dfile=%JDEV_HOME%/BC4J/lib/adfshare.jar -Dpackaging=jar -DrepositoryId=%REPO_ID% -Durl=%REPO_URL%

38 may 31, 2007 UnitTest ADF applications BC4J JUnit extension JDBC based AM configuration 'Basetest' per application module  Utility methods to create connection, handle jaas and provide easy access to view objects Define (at least) a testcase per viewobject protected HrServiceImpl getHrService () { return (HrServiceImpl) getApplicationModule(); }

39 may 31, 2007 Integration tests Start application server Prepare the database Deploy application Run tests  front-end  database  application Undeploy application Stop application server

40 may 31, 2007 Integration tests Front-end  Selenium Back-end / Database  QCTO  utPLSQL Tools  dbunit  Maven sql plugin  Maven exec plugin  (JDeveloper) ant tasks

41 may 31, 2007 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

42 may 31, 2007 Example org.codehaus.mojo exec-maven-plugin deployApp pre-integration-test exec ${java.home}/bin/java -jar ${oc4j.adminclient.home}\j2ee\home\admin_client.jar ${ias.deploy.url} ${ias.username} ${ias.password} -deploy -file../ear/target/hr1-ear-${version}.ear -deploymentName hr1 -bindAllWebApps java -jar C:\server\oc4j_101310\j2ee\home\admin_client.jar deployer:oc4j:localhost oc4jadmin oc4jadmin -deploy -file hr1-ear-1.0-SNAPSHOT.ear -deploymentName hr1 -bindAllWebApps

43 may 31, 2007 Project organisation Directory layout  default Maven layout Multi module projects

44 may 31, 2007 ADF Archetype AMIS maven-archetype-adf : mvn archetype:create -DarchetypeGroupId=nl.amis.maven.archetypes -DarchetypeArtifactId=maven-archetype-adf -DarchetypeVersion= DremoteRepositories= -DgroupId=nl.amis.demo.odtug -DartifactId=hr1

45 may 31, 2007 projectfile generation Create jws and jpr files myFaces - Trinidad JDev plugin  Add to internal (or local) repository Execute (AMIS / AXI version) : mvn nl.amis.maven.plugins:maven-axi-jdev-plugin: :jdev

46 may 31, 2007 Issues Regeneration is possible Add pom manually to project properties Project and repo on same disk No JHeadstart generation  but could be easily added Version No official Maven plugin yet

47 may 31, 2007 Running Maven from JDeveloper Waiting for a JDeveloper extension ;-) Ant tasks

48 may 31, 2007 Conclusion Continuous integration is essential for the development process! Using Maven, ADF Faces applications can be continuously integrated!

49 may 31,