YOUR FEEDBACK
SOA Feature Story: Real-Time SOA Starts with the Messaging Bus!
Gerardo Pardo-Castellote wrote: Regarding the previous comment about "TCP ...


2007 West
GOLD SPONSORS:
Active Endpoints
Your SOA Needs BPEL for Orchestration
BEA
Virtualized SOA: Adaptive Infrastructure for Demanding Applications
Nexaweb
Overcoming Bandwidth Challenges with Nexaweb
TIBCO
What is Service Virtualization?
SILVER SPONSORS:
WSO2
Using Web Services Technologies and FOSS Solutions
Click For 2007 East
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
SYS-CON.TV
TOP THREE LINKS YOU MUST CLICK ON


The Maven Build Process
A smooth transition

Digg This!

Page 2 of 3   « previous page   next page »

The key Maven concepts are described in the following that will aid in achieving build process objective.

Build Lifecycle
A typical project build lifecycle covers: prepare resources, compile sources, prepare test resources, compile test sources, execute test cases, and package component. Based on the best practices adopted in the project build, Maven has defined a sequence of tasks executed during this build lifecycle. Contrary to other build tools, it eases developers on the project from developing the build file for project that defines the list of build tasks and their sequence of execution.

Maven is extendable in that a build lifecycle can be defined on its own and associated with any project.

Configuration files
There are two critical configuration files in Maven: Settings.xml and POM.xml.

Default Settings.xml file is included in the Maven installation bundle and used to configure Maven execution. Unlike POM.xml, it is not project-specific. The configurations done here are local repository location, proxy server details, internal repository and its authentication information.

POM.xml is Maven configuration file for the project and is a one-stop-shop for all things concerning the project. It configures:

  • Maven Co-ordinates - Artifacts generated from Maven-enabled projects follow a specific address notation as groupid:artifactid:version that marks their location in the internal repository. The groupid, artifactid, and version are configured in POM.xml so a log4j-1.2.4 artifact will have its groupid as log4j, artifactid as log4j, and version as 1.2.4
  • POM Relationships - Maven is capable of handling project relationships like dependencies, inheritance, and aggregation. Inheritance is helpful in cases where certain configurations are unique across projects so these are defined in a 'Super POM' that's inherited by other project POM files. Aggregation is useful in a project that has multiple modules each with its own POM file; these modules are listed in the main project POM file and executed as a group. Dependencies are used to define the dependent projects and are detailed below.
  • Other Information - There's a build setting element that's used to configure a project's directory structure and manage plug-ins and reporting elements. Other project information like licenses, organization, developers, and mailing lists are configured here and incorporated into the project site built using Maven.
Dependencies Management
Almost all of the development projects depend on other existing frameworks, utilities, and APIs since this helps the projects to reuse rather than reinvent and so saves time, money, and resources. The projects might put all these dependent components in a folder and have a build tool use them when building the project. These artifacts also need to be maintained along with the project code base to be able to build later time with consistency. Most of the time these dependent components are checked into version management system along with the project code base.

This is not a preferred solution because:
1)  Dependent components (mostly JAR files) are binary files and version management systems are better at handling text files than binary files.
2)  Say there are two projects that depend on the Log4j-1.2.4 component. Each project would then have to maintain a copy of this component in the version management system. This increases the size of the version control database and adds to the hardware cost.
3)  And if a project is dependent on, say, 15 components and all of them are maintained in the version management system then normal operations like checkout and updating the versioning system will be slower.

Therefore, Maven recommends maintaining an enterprise-wide repository that will manage the dependent components and their versions. In Maven-speak these dependent components - and the components generated from the build process - are known as artifacts.

Repositories
Repositories are collections of artifacts that adhere to the Maven repository directory layout. To be a Maven repository artifact, it must live in the groupId/artifactId/version structure whose values are defined in the artifact's POM.xml project.

Maven deals with three kinds of repositories:

  • External repository: This Maven repository is located in http://repo1.maven.org and maintained by a bunch of contributors. Open source artifacts are maintained here per the Maven repository structure standard that locates the artifact under its groupid -> artifactid -> version.
  • Internal repository: This is an enterprise-wide repository maintained by an organization and holds in-house artifacts and the cache of any artifacts downloaded from an external repository. There are products available that help maintain this artifact repository. One such product is Artifactory, which is used in this process architecture. Artifactory has a friendly Web UI to manage repository like deploy artifact, download artifact, browse repository and manage user security.
  • Local repository: Maven maintains a cache of dependent artifacts of the project's built using Maven on local machine. This repository's location is configured in Settings.xml.
Repositories can be local or remote and are a place to store artifacts. Whenever a project has a dependency on an artifact, Maven will first attempt to use a local copy (in the local repository) of the specified artifact. If the artifact doesn't exist in the local repository, it will then attempt to download it from an internal repository. If the artifact isn't in the internal repository either then Maven reaches out to the external repository and downloads the artifact from there. The repository elements in Settings.xml specify the alternate repositories to search.


Page 2 of 3   « previous page   next page »

About Ravi Muthusubramanian
M.Ravi is a technical architect for the Banking & Capital Markets Division of Infosys. He has almost 8 years of experience in various facets of the software development life cycle and specializes in providing architecture and design solutions based on broad of spectrum of technologies including JEE, SOA, Message Broker, SAS and CRM.

LATEST JAVA STORIES & POSTS
Saving Your Investment: Transforming J2EE applications into Web 2.0 using GWT
The pressure is on to keep pace with Web 2.0 entrants into the marketplace. Rewriting is expensive; adding AJAX widgets results in a complex, unmaintainable application. Both require you to hire scarce JavaScript developers. Google Web Toolkit -- the SDK that allows you to write
WSRP Really Works! - Part 2
A standard from OASIS called Web Services for Remote Portlets (WSRP) is used so portlets can be decoupled from a portal. In part one (JDJ, Volume. 13, issue 3) of this article, we introduced the relevant standards and specifications and then demonstrated WSRP's capabilities by co
Adobe's Kevin Lynch and Microsoft's Scott Guthrie to Keynote AJAX World RIA Conference & Expo
Two of the biggest launches in Rich Internet Application history took place in 2007/2008 when Adobe launched AIR 1.0 in February '08 and Microsoft launched Silverlight (September '07). At the 6th International AJAXWorld RIA Conference & Expo in October SYS-CON Events is delighted
Sun Expects Q4 Earnings Above Estimates
On Tuesday evening Sun issued a fourth-quarter guidance range largely above analysts' estimates. The company pre-announced that revenue for its fiscal fourth quarter ended June was $3.725 billion to $3.8 billion, with gross margin in the 44-45% range. Sun expects non-GAAP profits
Virtualization Conference Keynote Webcast Live on SYS-CON.TV
Brian Stevens, the Chief Technology Officer and Vice President of Engineering of Red Hat, delivered his Virtualization Keynote 'The Future of the Virtual Enterprise' at SYS-CON's Virtualization Conference & Expo 2007 West in San Francisco. 'Virtualization is the hottest subject
The Beauty of JavaScript
JavaScript is one of the most interesting and misunderstood programming languages in common use today. Most developers will go their entire careers without realizing its full potential. It's not often that you get a language that supports the feature set that JavaScript does, whi
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS

SPONSORED BY INFRAGISTICS
SOA in a JVM: OSGi Service Platform - A Dynamic Component System for Java
There are many forces that influence technological evolution. After a decade of building enterprise
AJAX and Enterprise RIA Tools - JSF, Flex, and JavaFX
2008 is going to be an important year for Rich Internet Applications. Most organizations are deliver
Final Voting Phase on OpenAjax Browser Wishlist
The OpenAjax Alliance is developing an Ajax industry wishlist for future browsers, using a dedicated
AJAX World RIA Conference News - Netflix UI Guru To Present on Crafting Rich Web Interfaces
In every field of design one of the first things students do is learn from the work of others. They
Infragistics Releases CTP UI Components for Microsoft Silverlight Beta 2
Infragistics announced the availability of two Community Technology Preview (CTP) User Interface (UI
Yahoo User Interface 2.5.2 Released
The YUI development team has released version 2.5.2; you can download the new release from SourceFor
ADS BY GOOGLE
BREAKING JAVA NEWS
Domark International, Inc. Completes Its Acquisition of Javaco, Inc.
Domark International, Inc. (OTCBB:DOMK) announced today that it has completed its acqui