19
eGovFrame Training Book Development Environment eGovFrame Center 2012

02.egovFrame Development Environment training book

Embed Size (px)

DESCRIPTION

eGovFrame - Framework for e-goverment Development Environment - Concept

Citation preview

Page 1: 02.egovFrame Development Environment training book

eGovFrame Training BookDevelopment Environment

eGovFrame Center

2012

Page 2: 02.egovFrame Development Environment training book

Table of contents

Overview

Maven

CI (Continuous Integration) Server

Page l 2

I

II

III

Page 3: 02.egovFrame Development Environment training book

Page l 3

Development Environment Overview

Development Environment provides a set of tools on implementation(coding, debugging), test,

deployment and configuration which are needed to develop an application based on the

eGovFrame Runtime Environment

Implementation

Tools

Configuration

Management Tools

Test Tools

Distribution

Tools

Configuration and

Change Management

Editor, Debugger, Templates

Development Procedures

Build / Build Automation

(Maven)

Testing, Test Reporting and

Coverage Analysis

Page 4: 02.egovFrame Development Environment training book

Page l 4

Development Environment

Development Environment

Implementation

Tool

Test Tool Deployment Tool Conf. & Change

Mgt. Tool

Code Generation

Code Inspection

Debug

Editor

Methodology &

Template

Test Reporting

Unit Test

Build

Deployment

Configuration

Management

Change

Management

4 service groups, 11 services compose the development environment

Support various tools that are required for a programming based on eGovFrame

Composition of eGovFrame

Page 5: 02.egovFrame Development Environment training book

Page l 5

Development Environment

Development Environment

Implementation

Tool

Test Tool Deployment Tool Conf. & Change

Mgt. Tool

Code Generation

Code Inspection

Debug

Editor

Methodology &

Template

Test Reporting

Unit Test

Build

Deployment

Configuration

Management

Change

Management

4 service groups, 11 services compose the development environment

Support various tools that are required for a programming based on eGovFrame

Composition of eGovFrame

Page 6: 02.egovFrame Development Environment training book

Page l 6

General programming process

Coding Build

• Compile

• Packaging

Build

DeployWAS restart

Success?

Yes

No

• Compile

• Packaging

Developer PC Development Server

Operation Server

Configuration

management• Code editing

• Testing

• Debugging

• Inspection

Commit Checkout

Adopt eclipse IDE*), and provide programming support tools through the entire

programming lifecycle, which is from coding to deployment

Composition of eGovFrame

IDE*) : Integrated Development Environment

Page 7: 02.egovFrame Development Environment training book

Page l 7

Eclipse IDE Overview Composition of eGovFrame

eGovFrame menu Change to eGovFrame perspective

Provide various editors such as DBIO, UML, ERD , etc

Provide various views such as DBIO Search, Query Result, etc

Use various views

such as OutlineView,

etcProvide views such as Package

Explorer,

Data Source Explorer, etc

Implementation tools provide characterized perspective, integrated menu, views and editors

in order to present an easy and convenient development environment for developers.

Page 8: 02.egovFrame Development Environment training book

Page l 8

eGovFrame IDE – eGovFrame integrated menu Composition of eGovFrame

Only activate in eGovFrame Perspective

Integrated menu for quick access to eGovFrame related plug-ins

Start

- New Core Project

: create eGovFrame Core Project

- New Web Project

: create eGovFrame Web Project

- New Template Project : create eGovFrame Template Project

Analysis

- New Usecase Diagram : create Usecase Diagram

Design

- New ER Diagram : create ER Diagram

- New Class Diagram : create Class Diagram

Implementation

- Add eGovFrame Common Component : create Common Component

- New SQL Map Config : create SQL Map Config file

- New SQL Map : create SQL Map file

- Show DBIO Search View : display DBIO Search View

Configuration

- Customize Development Tool : optionally install the required functionality

- Server Connection Management · Show SVN Repositories View : display SVN Repositories View

· Nexus : manage Nexus repository information

Page 9: 02.egovFrame Development Environment training book

Page l 9

eGovFrame IDE – eGovFrame Update

Install or update eGovFrame in development environment

Composition of eGovFrame

Page 10: 02.egovFrame Development Environment training book

Page l 10

Build – Maven : Architecture Distribution Tools

Maven Architecture

POM.XML Repositories

(local and

remote)

Project Object

Model

Dependency

Management

Model

Project life cycle and phases

Plugins

Source

filesReporting Resources Compile

Packaged

libraries

Maven was originally started as an attempt to simplify the build process and provides a

standard way to build projects. It includes a clear definition of what the project consisted

of(POM), dependency management(library control), project life cycle management, etc

Page 11: 02.egovFrame Development Environment training book

Page l 11

Build – Maven : Directory Structure

Providing a standard directory structure

Maven Standard Directory StructureDirectory/File Description

/pom.xml

The core of a project's configuration in Maven.

It is a single configuration file that contains the

majority of information required to build a

project. (Ex: dependency)

/src/main/javaLocate Java Source file. Compiled to

“target/classes” directory

/src/main/resourcesResources for deploying, namely XML,

properties, etc. Copied to “target/classes”

/src/main/webappWeb application related files (/WEB-

INF/web.xml, webapp/index.jsp, css, etc)

/src/test/javaTest case Java sources. Compiled to

“target/test-classes”

/src/test/resourcesResources for testing. Copied to “target/test-

classes”

/target Build outputs are located

Distribution Tools

Page 12: 02.egovFrame Development Environment training book

Page l 12

The POM contains all necessary information about a project, as well as configurations of plugins

to be used during the build process. groupId:artifactId:version are all required fields and act much

like an address and timestamp in a repository, acting like a coordinate system for Maven projects

Build Settings

Properties

Build

Packaging

Reporting

Project Information

Name

URL

Description

Artifact

Group Id

Version

Artifact Id

Inception Year

Dependencies

Dependencies

Repositories

Repositories

<project xmlns=http://maven.apache.org/POM/4.0.0 ....>

<groupId>egovframework.dev.com</groupId>

<artifactId>egovframework-dev-com</artifactId>

<version>1.0</version>

<packaging>war</packaging>

<dependencies>

<dependency>

<groupId>junit</groupId>

<artifactId>junit</artifactId>

<version>4.4</version>

<scope>test</scope>

</dependency>

</dependencies>

<plugins>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-compiler-plugin</artifactId>

<configuration>

<source>1.5</source>

</configuration>

</plugin>

</plugins>

</project>

Artifact Info.

Dependency

Management

Plug-in

Setting

POM.XML

Build – Maven : pom.xml Distribution Tools

Page 13: 02.egovFrame Development Environment training book

Page l 13

Build – Maven : Build Lifecycle

Build Lifecycle Maven2 Build Lifecycle Phase

Maven command ex) $mvn install

Validate

Compile

Test

Package

Verify

Install

deploy

P

O

M

archetype

compiler

surefire

jar

install

Lifecycle Phases Plugins

mvn compile

mvn install

mvn

test

Maven 2.0 is based around the central concept of a build lifecycle. What this means is that

the process for building and distributing a particular artifact (project) is clearly defined.

Phase Description

Validatevalidate the project is correct and all necessary

information is available

Compile compile the source code of the project

Testtest the compiled source code using a suitable unit testing

framework

Packagetake the compiled code and package it in its distributable

format, such as a JAR

Verifyrun any checks to verify the package is valid and meets

quality criteria

Installinstall the package into the local repository, for use as a

dependency in other projects locally

Deploycopies the final package to the remote repository for

sharing with other developers and projects

Distribution Tools

Page 14: 02.egovFrame Development Environment training book

Page l 14

m2eclipse Maven Build Maven install

Click “Maven install” to initiate build lifecycle phase. It

packages and installs the project into the local

repository

“m2eclipse” plug-in to use Maven in egovframework IDE

Distribution ToolsBuild – Maven : Plug-in

Page 15: 02.egovFrame Development Environment training book

Page l 15

Build – Maven : Repository

Using libraries that declared in the pom.xml of the project as dependency and the libraries come

from the repository. If it exits in local repository, use it, if not, download from the remote

repository to local and use.

Internet Internet

Public Maven

Repository

Computer 1

Computer 2

Computer 3

Utilizing Maven Repository ManagerMaven Repository Composition Diagram

Public Maven

Repository

Computer 1

Computer 2

Computer 3

Internet Internet

Maven Repository

(Nexus)

Distribution Tools

Page 16: 02.egovFrame Development Environment training book

Page l 16

Build – Maven : Nexus

Nexus manages software artifacts required for development, deployment, and provisioning.

Also it simplifies the maintenance of internal repositories and access to external repositories

Distribution Tools

Page 17: 02.egovFrame Development Environment training book

Page l 17

Source Code Build

Feedback Mechanism

Unit Tests

Test Coverage

AnalysisBuild Success

Development Server

CI ServerVersion Control Server

(SVN)

Build Failed

Code Inspection

Developer

Developer

Deploy

Code

Commit

Code

Commit

Watch & Polling

Notice

CI Server - Build Automation Tool

Hudson as a CI(Continuous Integration) server

Distribution Tools

Page 18: 02.egovFrame Development Environment training book

Page l 18

Main Screen : Display a list of projects, build status and build success or failure

CI Server - Hudson Build

Hudson as an open source CI server provides automatic build with a script and offers a feedback

mechanism about build results to developers

Distribution Tools

Page 19: 02.egovFrame Development Environment training book

Page l 19

CI Server - Hudson Dashboard

Providing a dashboard function to show build, test results, etc

Distribution Tools