developer and fusion middleware 1 | mark nelson | continuous integration for soa bpm 11g.pdf

49
<Insert Picture Here> Continuous Integration for Oracle SOA Suite and Oracle Unified Business Process Management Suite Mark Nelson Consulting Solution Architect The A-Team

Upload: insync2011

Post on 22-Nov-2014

1.978 views

Category:

Documents


4 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

<Insert Picture Here>

Continuous Integration for Oracle SOA Suite and Oracle Unified Business Process Management Suite Mark Nelson Consulting Solution Architect The A-Team

Page 2: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

2

THE FOLLOWING IS INTENDED TO OUTLINE OUR GENERAL PRODUCT DIRECTION. IT IS INTENDED FOR INFORMATION PURPOSES ONLY, AND MAY NOT BE INCORPORATED INTO ANY CONTRACT. IT IS NOT A COMMITMENT TO DELIVER ANY MATERIAL, CODE, OR FUNCTIONALITY, AND SHOULD NOT BE RELIED UPON IN MAKING PURCHASING DECISION. THE DEVELOPMENT, RELEASE, AND TIMING OF ANY FEATURES OR FUNCTIONALITY DESCRIBED FOR ORACLE'S PRODUCTS REMAINS AT THE SOLE DISCRETION OF ORACLE.

Page 3: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

3

Who are the A-Team?

Page 4: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

4

We’re these guys!

Page 5: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

5

Agenda

•  Introduction – What is Continuous Integration? •  Building Blocks

•  Subversion •  Maven •  Hudson •  Alternatives

•  The WebLogic Maven Plugin •  The SCA build process •  Handling MDS •  Handling Task Forms •  Putting it all together

Page 6: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

6

Continuous Integration

•  Continuous Integration is a software engineering practice which attempts to improve quality and reduce time to deliver

•  This is done by applying small, frequent quality control efforts

ORACLE CONFIDENTIAL

Let’s see an example…

Page 7: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

7

Without Continuous Integration

ORACLE CONFIDENTIAL

1 ”HEAD”  

We want to make some changes to an artifact in our project…

Page 8: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

8

Without Continuous Integration

ORACLE CONFIDENTIAL

1 ”HEAD”  

1

Check  out  

… so we check out the artifact from the version control system …

Page 9: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

9

Without Continuous Integration

ORACLE CONFIDENTIAL

1 ”HEAD”  

1

Check  out  

1’ Change  

… and we make our changes. This may take several days …

Page 10: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

10

Without Continuous Integration

ORACLE CONFIDENTIAL

1 2 3 4 5 ”HEAD”  

1

Check  out  

1’ Change  

… meanwhile, other developers have made changes too, and have checked them in to the version control system …

Page 11: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

11

Without Continuous Integration

ORACLE CONFIDENTIAL

1 2 3 4 5 6 ”HEAD”  

1

Check  out  

1’ Change  

Integrate  

… when we are ready to check our changes back in to the version control system (“integrate”) there is a big difference between our version and the HEAD version. This means integration will likely be difficult and time consuming …

Page 12: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

12

Without Continuous Integration

ORACLE CONFIDENTIAL

1 2 3 4 5 6 ”HEAD”  

1

Check  out  

1’ Change  

Integrate  

… it also means that when the next build happens, it is much more likely to have errors due to inconsistencies introduced by all these small changes made by different developers.

Build

Page 13: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

13

With Continuous Integration

ORACLE CONFIDENTIAL

1 ”HEAD”  

1

Check  out  

With continuous integration, we build every time there is a commit to HEAD. When we want to make changes we check out from version control …

Build

Page 14: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

14

With Continuous Integration

ORACLE CONFIDENTIAL

1 2 ”HEAD”  

1

Check  out  

1’ Change  

… and make our changes. We should make fewer changes between commits to minimize the integration burden. Other developers will still be making changes in parallel and we will build when they commit ...

Build Build

Page 15: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

15

With Continuous Integration

ORACLE CONFIDENTIAL

1 2 ”HEAD”  

1

Check  out  

1’ Change  

Integrate  

… so when we come to integrate our changes, there is (so the theory goes) less work for us to do. We will also know very quickly if we have broken the build (minutes instead of days/weeks).

Build 3 Build 4 Build

Page 16: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

16

Continuous Integration – Key Practices

•  Continuous Integration is characterized by these key practices:

•  Use of version control system •  All developers commit to the HEAD every day •  Build on every commit •  The build must be automated and fast •  Automated deployment to a production-like environment •  Automated testing •  Results of all builds are published (so everyone can see who

broke the build) •  Deliverables are easily available (for developers, testers,

other stakeholders)

ORACLE CONFIDENTIAL

Page 17: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

17

Agenda

•  Introduction – What is Continuous Integration? •  Building Blocks

•  Subversion •  Maven •  Hudson •  Alternatives

•  The WebLogic Maven Plugin •  The SCA build process •  Handling MDS •  Handling Task Forms •  Putting it all together

Page 18: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

18

Building Blocks - Subversion

•  We need a version control system and Subversion is arguably the best choice for us today

•  It is widely used and understood •  It is well integrated with our other building blocks (Maven,

Hudson) •  It is well integrated with JDeveloper •  It can be used with strong authentication and through proxies,

VPNs, etc.

ORACLE CONFIDENTIAL

Page 19: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

19

Building Blocks - Subversion

•  Subversion is used to:

•  Store our source artifacts •  Share them between developers •  Manage versions of artifacts

ORACLE CONFIDENTIAL

Page 20: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

20

Agenda

•  Introduction – What is Continuous Integration? •  Building Blocks

•  Subversion •  Maven •  Hudson •  Alternatives

•  The WebLogic Maven Plugin •  The SCA build process •  Handling MDS •  Handling Task Forms •  Putting it all together

Page 21: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

21

Building Blocks - Maven

•  Maven is a project management and build management system

•  Project management in terms of: •  Managing naming and version numbering •  Managing dependencies •  Managing where source code is stored •  Managing where builds are stored •  Managing templates for project types •  Managing the release process

ORACLE CONFIDENTIAL

Page 22: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

22

Building Blocks - Maven

•  Maven is a project management and build management system

•  Build management in terms of:

•  How to execute the build •  What to do in each phase •  Parameterization of the build •  An extensible framework

ORACLE CONFIDENTIAL

Page 23: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

23

Maven Build Lifecycle

•  Maven is based around the central concept of a build lifecycle •  The process for building and distributing a particular artifact

(project) is clearly defined •  Only necessary to learn a small set of commands to build any

Maven project, the POM ensures the project is built correctly •  default, clean, site !

•  Build lifecycles are further defined by a set of build phases •  A build phase represents a stage in the lifecycle •  Executed sequentially to complete the default lifecycle

•  Build phase made up of goals •  Phases are composed of goals that perform actual tasks •  Default goal bindings for standard lifecycle phases •  Plugins contribute additional goals to project

Page 24: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

24

Maven Default Lifecycle

validate: ensure the project is correct and all necessary information is available

compile: compile the source code of the project

test: test the compiled source code using a suitable unit testing framework; tests should not require the code be packaged or deployed

package: take the compiled code and package it in its distributable format, such as a JAR, WAR, etc.

integration-test: process and deploy the package if necessary into an environment where integration tests can be run

verify: run checks to verify the package is valid and meets quality criteria

install: install the package into the local repository, for use as a dependency in other projects locally

deploy: for final release, copies the final package to the remote repository for sharing with other developers and projects.

h"p://maven.apache.org/guides/introduc5on/introduc5on-­‐to-­‐the-­‐lifecycle.html  

Page 25: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

25

The Maven Process: End-to-End

Project pom.xml

Local repository

Custom plugins

Maven Build package

Maven Plugins

Input   Output  

Page 26: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

26

Agenda

•  Introduction – What is Continuous Integration? •  Building Blocks

•  Subversion •  Maven •  Hudson •  Alternatives

•  The WebLogic Maven Plugin •  The SCA build process •  Handling MDS •  Handling Task Forms •  Putting it all together

Page 27: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

27

•  Hudson is a common Continuous Integration server

•  It is based around the concept of a ‘job’

•  The Hudson dashboard displays status of all jobs

Building Blocks - Hudson

Page 28: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

28

•  Builds can be automatically triggered from SCM changes

•  Jobs can be created directly from a Maven project

•  Can execute any combination of Maven goals

Building Blocks - Hudson

Page 29: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

29

•  Allows automatic deployment to WLS and SOA on an SCM change

•  Integration tests can be run against applications and composites on WLS/SOA

•  Results reported in build status

Building Blocks - Hudson

Page 30: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

30

Agenda

•  Introduction – What is Continuous Integration? •  Building Blocks

•  Subversion •  Maven •  Hudson •  Alternatives

•  The WebLogic Maven Plugin •  The SCA build process •  Handling MDS •  Handling Task Forms •  Putting it all together

Page 31: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

31

Alternatives

•  Version control •  git

•  Allows distributed version control and offline commit •  Seen as becoming more popular •  Has some integration with JDeveloper too

•  CVS •  Works fine, but recommend not using the SCM polling in

Hudson/Jenkins with CVS due to CVS versioning model (every file)

•  Continuous Integration •  Hudson/Jenkins •  Continuum

ORACLE CONFIDENTIAL

Page 32: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

32

Agenda

•  Introduction – What is Continuous Integration? •  Building Blocks

•  Subversion •  Maven •  Hudson •  Alternatives

•  The WebLogic Maven Plugin •  The SCA build process •  Handling MDS •  Handling Task Forms •  Putting it all together

Page 33: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

33

The WebLogic Maven Plugin

• WebLogic Server 11g R1 (10.3.4) provides an official Maven plugin to perform application deployment operations •  Maven Mojo + WebLogic Deployer + WebLogic Client

•  Supports the deployment of Maven projects to WebLogic Server directly from Maven •  No need to use console or command line deployment

utility •  Can be wired into Maven lifecycle to automate

deployment for specific goals

Page 34: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

34

WebLogic Maven Plugin Goals

Page 35: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

35

Agenda

•  Introduction – What is Continuous Integration? •  Building Blocks

•  Subversion •  Maven •  Hudson •  Alternatives

•  The WebLogic Maven Plugin •  The SCA build process •  Handling MDS •  Handling Task Forms •  Putting it all together

Page 36: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

36

The SCA build process

ORACLE CONFIDENTIAL

•  SCA builds are done using a set of ANT build files and tasks •  Called ‘under the covers’ by JDeveloper •  Or from the command line (so they can be automated)

Page 37: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

37

The SCA build process

ant-sca-compile.xml, target: scac

scac.input: The location of the composite.xml

scac.application.home: The location of the Application directory

ant-sca-package.xml, target: package

compositeName: The name of the composite (will show up in EM)

compositeDir: The directory containing the composite

revision: The version number for the composite

scac.application.home: The location of the Application directory

ORACLE CONFIDENTIAL

Page 38: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

38

The SCA build process

ant-sca-deploy.xml, target: deploy serverURL: The URL of the SOA instance

user: The user to do the deployment

password: The deploying user's password

sarLocation: The location of the SAR file

overwrite: Overwrite existing deployments with

same revision?

forceDefault: Make this version the default version?

partition: Which SOA partition to deploy into

ant-sca-test.xml, target: test

jndi.properties.input The name of the JNDI properties file

scatest.input The name of the composite to test

scatest.format The format for the results – “junit”

scatest.result The relative path to store the results in

ORACLE CONFIDENTIAL

Page 39: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

39

Agenda

•  Introduction – What is Continuous Integration? •  Building Blocks

•  Subversion •  Maven •  Hudson •  Alternatives

•  The WebLogic Maven Plugin •  The SCA build process •  Handling MDS •  Handling Task Forms •  Putting it all together

Page 40: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

40

Some service components depend on Metadata Services (MDS)

•  For example: •  Human Tasks consume XSD from MDS •  Rules consume XSD from MDS

•  You may also choose to deploy canonical data models, abstract service definitions, etc. to MDS

•  Your project will need an MDS connection defined in adf-config.xml, either: •  File-based MDS, or •  Database MDS

•  And you must specify scac.application.home

ORACLE CONFIDENTIAL

Page 41: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

41

Agenda

•  Introduction – What is Continuous Integration? •  Building Blocks

•  Subversion •  Maven •  Hudson •  Alternatives

•  The WebLogic Maven Plugin •  The SCA build process •  Handling MDS •  Handling Task Forms •  Putting it all together

Page 42: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

42

Handling Task Forms

•  To build task form UI projects, we need to use the ojdeploy utility which is part of JDeveloper

•  This means the build servers need access to an installation of JDeveloper

•  We call ojdeploy using the exec-maven-plugin and pass in: •  workspace The name of the JWS file •  Profile The name of the deployment profile •  Clean To rebuild all

ORACLE CONFIDENTIAL

Page 43: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

43

Agenda

•  Introduction – What is Continuous Integration? •  Building Blocks

•  Subversion •  Maven •  Hudson •  Alternatives

•  The WebLogic Maven Plugin •  The SCA build process •  Handling MDS •  Handling Task Forms •  Putting it all together

Page 44: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

44

Putting it all together (without ADF)

ORACLE CONFIDENTIAL

MDS

ADF config

refers to

contains

Page 45: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

45

Putting it all together (with ADF)

ORACLE CONFIDENTIAL

Page 46: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

46

Agenda

•  Introduction – What is Continuous Integration? •  Building Blocks

•  Subversion •  Maven •  Hudson •  Alternatives

•  The WebLogic Maven Plugin •  The SCA build process •  Handling MDS •  Handling Task Forms •  Putting it all together

Page 47: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

47

More information about Continuous Integration for Oracle Fusion Middleware is available on my blog:

http://redstack.wordpress.com

Watch the blog for more detail leading up to OpenWorld and also for coverage of other products – OSB, ADF, WebCenter…

ORACLE CONFIDENTIAL

Page 48: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

48

Join us at Oracle OpenWorld 2011

•  Learn more about Continuous Integration for SOA/BPM at Oracle Develop, including:

•  Handling resources (JDBC, JMS, etc) •  Parameterization of the build •  Dependencies between projects •  Using Maven Archetypes •  Harvesting assets into OER

ORACLE CONFIDENTIAL

Page 49: Developer and Fusion Middleware 1 | Mark Nelson | Continuous Integration for SOA BPM 11g.pdf

<Insert Picture Here>

Continuous Integration for Oracle SOA Suite and Oracle Unified Business Process Management Suite Mark Nelson Consulting Solution Architect The A-Team