SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Building and Managing
Java Projects with Maven
Part-II
Create a New Project
Type:
maven genapp
It will prompt for
– project id
– project name
– project package name
A Sample Service J2EE Project
• EJB (stateless session beans exposed as web
services)
• Data components
• Web application
Directory Layout
Project Directory Layout
sampleservice
– project.xml - Master POM of the project
– maven.xml - Reactor definition
– project.properties - Properties related to the project
– application/ - Application component
– service-data/ - Common data component
– service-ejb/ - EJB/WS component
– service-web/ - Web Application component
– target/ - Generated artifact directory
– xdocs/ - Various documents in xml format
– …
Directory Layout
A Component Directory Layout
…
service-data - Data component subproject
– project.xml - POM of the data project
– maven.xml - Goals definition
– project.properties - Properties related to the project
– src/ - Source directory
– conf/ - Configuration and resource files
– java/ - Java source files
– test/ - Test source files
– target/ - Generated artifact directory
– xdocs/ - Various documents in xml format
…
Project Object Model (POM)
Projects are described as Project Object Model.
• Project Management
– Detailed description of the project.
– Company information.
– Developer roles and information.
– Mailing list and source control modules
configuration.
• Project Build
– Source code and test code location.
– Resources location
Project Object Model (POM)
• Project Dependency
– Libraries needed for build and runtime.
• Project Reports
– Junit reports
– Javadoc reports
– Checkstyle reports, ….etc
Project Management Section
<project>
<pomVersion>3</pomVersion>
<groupId>sampleservice</groupId>
<name>Sample Service</name> <!-- Used in Javadoc -->
<id>sampleservice</id>
<currentVersion>1.0</currentVersion>
<!-- Used for document creation -->
<organization>
<name>My, Inc.</name>
<url>http://www.myinc.com</url>
<logo>/images/logo.gif</logo>
</organization>
…
(elements in bold are required)
Project Management Section
<project>
[…]
<inceptionYear>2003</inceptionYear> <!-- Used in JavaDoc –
<package>com.myinc.sampleservice</package> <!-- Used in JavaDoc -->
<shortDescription>Demo to use maven</shortDescription> <!-- one liner -->
<!-- Used in front page-->
<description>
A detailed description about this demo
</description>
<url>http://www.myinc.com/sampleservice/</url>
<issueTrackingUrl/>
<siteAddress>dev.myinc.com</siteAddress> <!-- Used in deployment -->
<siteDirectory>/www/sampleservice/</siteDirectory> <!-- Used in deployment -->
<!-- Used in deployment. If defined, it overrides ${maven.repo.central} -->
<distributionSite>/www/dist/sampleservice</distributionSite>
<!-- Used in deployment, final distribution directory -->
<distributionDirectory>/www/www.myinc.com/somedir</distributionDirectory>
Project Management Section
<project>
[…]
<repository>
<connection>scm:cvs:pserver:anoncvs@cvs.myinc.com:/cvsroot:samples
ervice</connection>
<developerConnection>scm:cvs:pserver:${maven.username}@cvs.myinc.
com:/cvsroot:sampleservice</developerConnection>
<url>http://cvs.myinc.org/viewcvs/sampleservice/</url>
</repository>
<!-- Used in maven:dist -->
<versions>
<version>
<id>1.0-beta-1</id>
<name>1.0-beta-1</name>
<tag>1.0-beta-1</tag>
</version>
</versions>
<branches/>
[…]
…
<mailingLists/>
<contributors/>
<developers/>
…
Project Dependency Section
<project>
[…]
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.8</version>
<properties>
<ear.bundle>true</ear.bundle>
<ejb.manifest.classpath>true</ejb.manifest.classpat
h>
</properties>
</dependency>
</dependencies>
[…]
Special Dependency:
SNAPSHOT
Project Dependency Section
Dependency Classloader
[…]
<dependency>
<groupId>bcel</groupId>
<artifactId>bcel</artifactId>
<version>5.1</version>
<properties>
<classloader>root</classloader>
</properties>
</dependency>
[…]
Maven has three classloaders:
root -- ant classloader
root.maven – maven core classloader
default – plugin classloader
Project Dependency Section
Dependency Override
project.xml
…
<dependency>
<groupId>weblogic</groupId>
<artifactId>weblogic</artifactId>
<version>8.1.1</version>
<properties>
<classloader>root</classloader>
</properties>
</dependency>
project.properties
…
## Dependency override
maven.jar.override = on
maven.jar.weblogic = ${weblogic.home}/lib/weblogic.jar
maven.jar.webservices = ${weblogic.home}/lib/webservices.jar
Project Build Section
Defines the location of source, test and resource files.
[…]
<build>
<nagEmailAddress>buildmaster@myinc.com</nagEmailAddress>
<sourceDirectory>${src.java.dir}</sourceDirectory>
<unitTestSourceDirectory>${src.test.dir}</unitTestSourceDirectory>
<aspectSourceDirectory/>
[…]
src/aspect
src/test
src/java
Project Build Section
<unitTest>
<includes>
<include>**/*Test.java</include>
</includes>
<resources/>
</unitTest>
<resources>
<resource>
<directory>${src.conf.dir}</directory>
<targetPath/>
<includes>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
src/co
nf
prefix package name,
e.g. com.myinc.
sampleservice
Project Report Section
Defines various reports to be generated
<reports>
<report>maven-jdepend-plugin</report>
<report>maven-checkstyle-plugin</report>
<report>maven-changelog-plugin</report>
<report>maven-developer-activity-plugin</report>
<report>maven-file-activity-plugin</report>
<report>maven-javadoc-plugin</report>
<report>maven-jxr-plugin</report>
<report>maven-junit-report-plugin</report>
<report>maven-linkcheck-plugin</report>
<report>maven-tasklist-plugin</report>
</reports>
Project Report - Example
Jakarta Turbine
Project Report - XDoc
xdocs/navigation.xml
…
<menu name="General Information">
<item name="Overview" href="/index.html"/>
<item name="Features" href="/features.html"/>
<item name="Specification" href="/fsd.html"/>
<item name="Getting Started" href="/getting-started.html"/>
</menu>
xdocs/features.xml
<document>
<properties>
<title>Turbine Features</title>
<author email="">Jon S. Stevens</author>
</properties>
<body>
<section name="Features">
<p>This document is for bragging about all of Turbine's ….
…
</document>

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (17)

Maven in Mule
Maven in MuleMaven in Mule
Maven in Mule
 
JavaServer Faces 2.0 - JavaOne India 2011
JavaServer Faces 2.0 - JavaOne India 2011JavaServer Faces 2.0 - JavaOne India 2011
JavaServer Faces 2.0 - JavaOne India 2011
 
Modular applications with montage components
Modular applications with montage componentsModular applications with montage components
Modular applications with montage components
 
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dev...
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dev...Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dev...
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dev...
 
Built to Last
Built to LastBuilt to Last
Built to Last
 
Jsf Framework
Jsf FrameworkJsf Framework
Jsf Framework
 
Go Fullstack: JSF for Public Sites (CONFESS 2013)
Go Fullstack: JSF for Public Sites (CONFESS 2013)Go Fullstack: JSF for Public Sites (CONFESS 2013)
Go Fullstack: JSF for Public Sites (CONFESS 2013)
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHP
 
Web components - An Introduction
Web components - An IntroductionWeb components - An Introduction
Web components - An Introduction
 
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
 
Unit 07: Design Patterns and Frameworks (3/3)
Unit 07: Design Patterns and Frameworks (3/3)Unit 07: Design Patterns and Frameworks (3/3)
Unit 07: Design Patterns and Frameworks (3/3)
 
Spring 3 - Der dritte Frühling
Spring 3 - Der dritte FrühlingSpring 3 - Der dritte Frühling
Spring 3 - Der dritte Frühling
 
Jsf2 composite-components
Jsf2 composite-componentsJsf2 composite-components
Jsf2 composite-components
 
JSF 2.0 Preview
JSF 2.0 PreviewJSF 2.0 Preview
JSF 2.0 Preview
 
Hyperproductive JSF 2.0 @ JavaOne Brazil 2010
Hyperproductive JSF 2.0 @ JavaOne Brazil 2010Hyperproductive JSF 2.0 @ JavaOne Brazil 2010
Hyperproductive JSF 2.0 @ JavaOne Brazil 2010
 
Os Haase
Os HaaseOs Haase
Os Haase
 
Spring 3 - An Introduction
Spring 3 - An IntroductionSpring 3 - An Introduction
Spring 3 - An Introduction
 

Andere mochten auch

Andere mochten auch (20)

Maven part 1
Maven part 1Maven part 1
Maven part 1
 
Anypoint data gateway
Anypoint data gatewayAnypoint data gateway
Anypoint data gateway
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
 
Intro to Elixir
Intro to ElixirIntro to Elixir
Intro to Elixir
 
ToulouseJUG-Maven 3.x, will it lives up to its promises
ToulouseJUG-Maven 3.x, will it lives up to its promisesToulouseJUG-Maven 3.x, will it lives up to its promises
ToulouseJUG-Maven 3.x, will it lives up to its promises
 
Api Layer
Api LayerApi Layer
Api Layer
 
Maven 3.0 at Øredev
Maven 3.0 at ØredevMaven 3.0 at Øredev
Maven 3.0 at Øredev
 
Maven part 3
Maven part 3Maven part 3
Maven part 3
 
XECon2015 :: [1-2] 이현석 - Learning Laravel
XECon2015 :: [1-2] 이현석 - Learning LaravelXECon2015 :: [1-2] 이현석 - Learning Laravel
XECon2015 :: [1-2] 이현석 - Learning Laravel
 
Elixir - o que existe atrás do mistério
Elixir - o que existe atrás do mistérioElixir - o que existe atrás do mistério
Elixir - o que existe atrás do mistério
 
Oracle connector
Oracle connectorOracle connector
Oracle connector
 
Elixir and OTP
Elixir and OTPElixir and OTP
Elixir and OTP
 
Capa de persistencia con ecto
Capa de persistencia con ectoCapa de persistencia con ecto
Capa de persistencia con ecto
 
Maven 3.0 by jason - fossa2010
Maven 3.0 by jason - fossa2010Maven 3.0 by jason - fossa2010
Maven 3.0 by jason - fossa2010
 
Bootstrap |> Elixir - Easy fun for busy developers
Bootstrap |> Elixir - Easy fun for busy developersBootstrap |> Elixir - Easy fun for busy developers
Bootstrap |> Elixir - Easy fun for busy developers
 
SBT Crash Course
SBT Crash CourseSBT Crash Course
SBT Crash Course
 
Maven 3… so what?
Maven 3… so what?Maven 3… so what?
Maven 3… so what?
 
TDC2016SP - Trilha Programação Funcional
TDC2016SP - Trilha Programação FuncionalTDC2016SP - Trilha Programação Funcional
TDC2016SP - Trilha Programação Funcional
 
ITB2016 - Mixing up the front end with ColdBox elixir
ITB2016 - Mixing up the front end with ColdBox elixirITB2016 - Mixing up the front end with ColdBox elixir
ITB2016 - Mixing up the front end with ColdBox elixir
 
Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 Overview
 

Ähnlich wie Maven part 2

Juggling Java EE with Enterprise Apache Maven
Juggling Java EE with Enterprise Apache MavenJuggling Java EE with Enterprise Apache Maven
Juggling Java EE with Enterprise Apache Maven
elliando dias
 
Mobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best PracticesMobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best Practices
Andrew Ferrier
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
WO Community
 

Ähnlich wie Maven part 2 (20)

Maven ii
Maven iiMaven ii
Maven ii
 
Maven ii
Maven iiMaven ii
Maven ii
 
Maven introduction in Mule
Maven introduction in MuleMaven introduction in Mule
Maven introduction in Mule
 
Maven
MavenMaven
Maven
 
Apache Maven
Apache MavenApache Maven
Apache Maven
 
Intro to-ant
Intro to-antIntro to-ant
Intro to-ant
 
Maven iii
Maven iiiMaven iii
Maven iii
 
Maven iii
Maven iiiMaven iii
Maven iii
 
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
 
Juggling Java EE with Enterprise Apache Maven
Juggling Java EE with Enterprise Apache MavenJuggling Java EE with Enterprise Apache Maven
Juggling Java EE with Enterprise Apache Maven
 
Spring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsSpring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applications
 
Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen
Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen
Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with Maven
 
Angular or React
Angular or ReactAngular or React
Angular or React
 
Mobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best PracticesMobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best Practices
 
Javascript ui for rest services
Javascript ui for rest servicesJavascript ui for rest services
Javascript ui for rest services
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
 
Nick harris-sic-2011
Nick harris-sic-2011Nick harris-sic-2011
Nick harris-sic-2011
 
Adf spotlight-webcenter task flow-customzation
Adf spotlight-webcenter task flow-customzationAdf spotlight-webcenter task flow-customzation
Adf spotlight-webcenter task flow-customzation
 

Mehr von Mohammed246 (20)

Jenkins part 3
Jenkins part 3Jenkins part 3
Jenkins part 3
 
Jenkins part 2
Jenkins part 2Jenkins part 2
Jenkins part 2
 
Jenkins Part 1
Jenkins Part 1Jenkins Part 1
Jenkins Part 1
 
jBPM Connector
jBPM ConnectorjBPM Connector
jBPM Connector
 
Java for beginners
Java for beginnersJava for beginners
Java for beginners
 
Scatter gather
Scatter gather Scatter gather
Scatter gather
 
Velocity in Mule
Velocity in MuleVelocity in Mule
Velocity in Mule
 
Rabbit Mq in Mule
Rabbit Mq in MuleRabbit Mq in Mule
Rabbit Mq in Mule
 
Quartz in Mule
Quartz in MuleQuartz in Mule
Quartz in Mule
 
Simple web service vm
Simple web service vmSimple web service vm
Simple web service vm
 
Validate soap request in mule
Validate soap request in muleValidate soap request in mule
Validate soap request in mule
 
Web service vm in mule
Web service vm in muleWeb service vm in mule
Web service vm in mule
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
 
Drools in Mule
Drools in MuleDrools in Mule
Drools in Mule
 
Mule Esb Data Weave
Mule Esb Data WeaveMule Esb Data Weave
Mule Esb Data Weave
 
Idempotent filter in mule
Idempotent filter in muleIdempotent filter in mule
Idempotent filter in mule
 
Groovy example in mule
Groovy example in muleGroovy example in mule
Groovy example in mule
 
Creating dynamic json
Creating dynamic jsonCreating dynamic json
Creating dynamic json
 
Converting with custom transformer
Converting with custom transformerConverting with custom transformer
Converting with custom transformer
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

Maven part 2