The Stairway to Maven The Stairway to Maven The JAKARTA Project - - PowerPoint PPT Presentation

the stairway to maven the stairway to maven
SMART_READER_LITE
LIVE PREVIEW

The Stairway to Maven The Stairway to Maven The JAKARTA Project - - PowerPoint PPT Presentation

The Stairway to Maven The Stairway to Maven The JAKARTA Project Build The JAKARTA Project Build And Comprehension Tool And Comprehension Tool DI Siegfried GSCHL siegfried.goeschl@it20one.at 26.06.2002 The Problem How do you build and


slide-1
SLIDE 1

26.06.2002

DI Siegfried GÖSCHL siegfried.goeschl@it20one.at

The Stairway to Maven The Stairway to Maven

The JAKARTA Project Build The JAKARTA Project Build And Comprehension Tool And Comprehension Tool

slide-2
SLIDE 2

2 2 Stairway To Maven

The Problem How do you build and maintain complex software projects written in Java?! The Chinese Approach ...

– You can always find a student or two for the build

Make or better not to Make – that‘s the question ...

– Ever tried to run a UNIX makefile on Windows?!

All ANTs are equal and some are even more equal ...

– Tired of copy/pasting ANT scripts?! – Need something like ANT with more bells ans whistles?!

slide-3
SLIDE 3

3 3 Stairway To Maven

The Maven Message

The intent of Maven is to make intra The intent of Maven is to make intra-

  • project development highly manageable in

project development highly manageable in the hopes of providing more time for the hopes of providing more time for cross cross-

  • project development. You might call

project development. You might call it cross it cross-

  • project pollination or the sharing

project pollination or the sharing

  • f project development knowledge, this is
  • f project development knowledge, this is

what Maven attempts to encourage. what Maven attempts to encourage. Jason van Zyl Jason van Zyl

slide-4
SLIDE 4

4 4 Stairway To Maven

Maven For Rookies

  • Maven was initially

developed for buiding Turbine

  • Maven matured into an
  • pen source software

engineering platform

  • The core functionality is

automated project building, distribution and website creation

  • A project is described with

a XML Project Object Model (POM)

  • The POM defines how to

build a project and the external dependencies

  • The Maven functionality is

implemented in terms of plugins

  • The plugins are written in

Jelly

  • JARs are downloaded

from a remote repository and stored into a local repository

slide-5
SLIDE 5

5 5 Stairway To Maven

What is in the Maven Box?!

slide-6
SLIDE 6

6 6 Stairway To Maven

Under The Hood

Project Object Model (POM) Project Object Model (POM)

Verbose project description Company information List of developer and their roles Mailing list support CVS server access Source code and unit test code path JAR dependencies Versioning How to download

slide-7
SLIDE 7

7 7 Stairway To Maven

The Core Plugins The distribution plugin allows building a binary or a source distribution from the command line An ANT ANT build file can be generated and distributed to allow ANT ANT users to build the distribution Other plugins allows

– Creating a WAR file – Creating a JAR file – Deploying the distribution automatically Build Plugins Build Plugins

No more thrills building your project!

slide-8
SLIDE 8

8 8 Stairway To Maven

The Core Plugins Site creation based on Project Object Model Site generation uses XDOC

– Maven generated XDOC – Manually written documentation

DVSL transforms XDOC into HTML Site layout is defined through xdoc/navigation.xml xdoc/navigation.xml Site appearance is customizable through properties defined in project.properties project.properties

Site Plugin Site Plugin

slide-9
SLIDE 9

9 9 Stairway To Maven

The Core Plugins

Site Plugin Site Plugin

slide-10
SLIDE 10

10 10 Stairway To Maven

The Core Plugins

Site Plugin Site Plugin

slide-11
SLIDE 11

11 11 Stairway To Maven

The Core Plugins Various coding styles can be defined

– Sun coding convention – Turbine coding convention – Roll your own coding convention (if you really have to)

Rules are customizable through project.properties project.properties

– Maximum line length of 100 instead of 80 characters – Patterns for constants and variables – Setting a differnt tab width CheckStyle Plugin CheckStyle Plugin

Just in case you have a coding convention ...

slide-12
SLIDE 12

12 12 Stairway To Maven

The Core Plugins

CheckStyle Plugin CheckStyle Plugin

slide-13
SLIDE 13

13 13 Stairway To Maven

The Core Plugins Plugin accesses CVS directly to extract development activity information Extracts information about

– Changes and commits – Number of commits per developer – Number of changes for a file

Ongoing work to support VSS and ClearCase

Activity Plugin Activity Plugin

No more digging through CVS changelog

slide-14
SLIDE 14

14 14 Stairway To Maven

The Core Plugins

Activity Plugin Activity Plugin

slide-15
SLIDE 15

15 15 Stairway To Maven

The Core Plugins Runs JUNIT test case The plugin creates a XDOC XDOC report The XDOC XDOC report is then transformed to HTML The JUNIT JUNIT test report is then integrated within the generated project site

Test Plugin Test Plugin

I hope you have some tests?!

slide-16
SLIDE 16

16 16 Stairway To Maven

The Core Plugins

Test Plugin Test Plugin

slide-17
SLIDE 17

17 17 Stairway To Maven

The Core Plugins Is using JDepend JDepend from ClarkWare Reports package dependencies Finds cyclic dependencies Generates a HTML report to be included into project website

JDepend Plugin JDepend Plugin

slide-18
SLIDE 18

18 18 Stairway To Maven

The Core Plugins

JDepend Plugin JDepend Plugin

slide-19
SLIDE 19

19 19 Stairway To Maven

The Core Plugins Transforms source files into HTML files Provides syntax coloring and hypertext linking Allows linking between reports and actual source code as done with

– CheckStyle plugin – PMD plugin Java Cross Reference Plugin Java Cross Reference Plugin

slide-20
SLIDE 20

20 20 Stairway To Maven

The Core Plugins

Java Cross Reference Plugin Java Cross Reference Plugin

slide-21
SLIDE 21

21 21 Stairway To Maven

The Core Plugins

JavaDoc Plugin JavaDoc Plugin

slide-22
SLIDE 22

22 22 Stairway To Maven

No More Slides ...

slide-23
SLIDE 23

23 23 Stairway To Maven

Custom Plugins Everything in Maven Maven is a plugin Feel free to roll and contribute your own plugins Deployment of plugins as JAR files being dropped into the maven plugin directory There are many plugins available

– – CLOVER CLOVER Code Coverage Analyzer – – PMD PMD Static Source Code Analyzer – – JavaNCSS JavaNCSS Java Source Code Metric Analyzer – – Word2HTML Word2HTML – – ... ...

slide-24
SLIDE 24

24 24 Stairway To Maven

Custom Plugins Commercial software from The Cortex The Cortex Instruments the JUNIT JUNIT test case code Generates a HTML test coverage report

– Conditional Coverage – Statement Coverage – Method Coverage

Integrated into generated project site through Maven

Clover Test Coverage Plugin Clover Test Coverage Plugin

Another good reason for unit tests !!

slide-25
SLIDE 25

25 25 Stairway To Maven

Custom Plugins

Clover Test Coverage Plugin Clover Test Coverage Plugin

slide-26
SLIDE 26

26 26 Stairway To Maven

Custom Plugins

Clover Test Coverage Plugin Clover Test Coverage Plugin

slide-27
SLIDE 27

27 27 Stairway To Maven

Custom Plugins

  • PMD

PMD is a static source code analyzer

  • PMD

PMD is rule driven

– Basic rules – Import rules – Unused code rules – Naming rules – Design rules

The plugin creates an HTML report with linking to the Source Cross Reference

PMD Plugin PMD Plugin

slide-28
SLIDE 28

28 28 Stairway To Maven

Custom Plugins

PMD Plugin PMD Plugin

slide-29
SLIDE 29

29 29 Stairway To Maven

Custom Plugins

  • JavaNCSS

JavaNCSS is a source code metric analyzer Determines simple metrics

– Number of packages – Number of classes – Number of functions – Number of non-commented lines of code – Number of JavaDoc lines

Generates an XML report which is transformed to HTML using a XSL stylesheet

JavaNCSS Plugin JavaNCSS Plugin

slide-30
SLIDE 30

30 30 Stairway To Maven

Custom Plugins

JavaNCSS Plugin JavaNCSS Plugin

slide-31
SLIDE 31

31 31 Stairway To Maven

The Future Support of other version control systems for generating the activity report

– Microsoft‘s Visual Source Safe – Rational‘s ClearCase – Perforce

POM Inheritance Mechanism to simplify mavenizing mavenizing multiple projects

  • Quilt

Quilt intergration as Open Source alternative to Clover Clover There is a Source Forge Maven Plugin-in project

slide-32
SLIDE 32

32 32 Stairway To Maven

Conclusion

  • Maven

Maven is an Open Source project build and comprehension tool developed by the JAKARTA JAKARTA community

  • Maven

Maven is an integration platform for software engineering tools using a plug-in mechanism

  • Maven

Maven provides a remote and local JAR repository to simplify upgrading of JARs

  • Maven

Maven could be the answer to a lot of your software engineering problems And last but not least

slide-33
SLIDE 33

33 33 Stairway To Maven

The End

Any quest ions !?

slide-34
SLIDE 34

34 34 Stairway To Maven

Related Links

http://quilt.sourceforge.net/ QUILT QUILT http://jakarta.apache.org/velocity/dvsl/index.html DVSL DVSL http://jakarta.apache.org/ant/index.html ANT ANT http://maven-plugins.sourceforge.net/ Maven Plug Maven Plug-

  • ins

ins http://jakarta.apache.org/commons/sandbox/jelly/ Jelly Jelly http://www.clarkware.com/software/JDepend.html JDepend JDepend http://www.thecortex.net/clover/ Clover Clover http://jakarta.apache.org/turbine/index.html Turbine Turbine http://pmd.sourceforge.net/ PMD PMD http://www.kclee.com/clemens/java/javancss/ JavaNCSS JavaNCSS http://jakarta.apache.org/turbine/maven/ Maven Maven

slide-35
SLIDE 35

35 35 Stairway To Maven

Under The Hood The plugins are implemented in Jelly

– Jelly is a XML scripting language similar to ANT – Allows conditionals and loops – Compatible to ANT scrips

A plugin exports goals which are invoked

– Directly by a script – As pregoal or postgoal within Maven

A plugin can

– Start external application – Fork a JVM to execute Java code – Execute a Java code in-process Plugin Development Plugin Development