Bhavana Sudharshan Jaydeep Patel

Slides:



Advertisements
Similar presentations
Apache Maven: J2EE Front to Back Jesse McConnell -
Advertisements

Introduction to Maven 2.0 An open source build tool for Enterprise Java projects Mahen Goonewardene.
Developing in CAS. Why? As distributed you edit CAS 3 with Eclipse and build with Maven 2 – Best Practice for Release Engineering – Difficult edit-debug.
Introduction to Maven Michael Youngstrom. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to the Java Stack.
Build your Android App with Gradle Android new build system.
Managing your dependencies with Xavier Hanin
Functional Testing with the Java Stack Test Runner
ANT: Another Nice Tool Ali Beyad October 1, 2003.
ANT: Another Nice Tool Ali Beyad October 1, 2003.
Java Build Tool Comparison HJUG - April 29th, 2009 John Tyler.
Java development infrastructure at FMI Pekka Rantala FMI.
Maven: Build and project management in the 21th century.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
© S Ramakrishnan1 Systems V & V, Quality and Standards Dr Sita Ramakrishnan School CSSE Monash University.
Using Ant to build J2EE Applications Kumar
APACHE MAVEN Bhavana Sudharshan Jaydeep Patel. Introduction What is Maven? “Maven is a software management and comprehension tool based on the concept.
Version Control with Subversion. What is Version Control Good For? Maintaining project/file history - so you don’t have to worry about it Managing collaboration.
Maven and Stack Starter Michael Youngstrom. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack.
Maven & Bamboo CONTINUOUS INTEGRATION. QA in a large organization In a large organization that manages over 100 applications and over 20 developers, implementing.
MAVEN-BLUEMARTINI Yannick Robin. What is maven-bluemartini?  maven-bluemartini is Maven archetypes for Blue Martini projects  Open source project on.
Sumedha Rubasinghe October,2009 Introduction to Programming Tools.
Apache Ant Java-Based Build Tool. Making your builds boring… Building projects should be easy and standardized. You should not be spending a substantial.
LDS Account Integration. Disclaimer This is a training NOT a presentation. – Be prepared to learn and participate in labs Please ask questions Prerequisites:
Apache Ant A gateway to test-driven Java development.
Using the ALM Module Fully Automated Deployments in Stack 3.2.
1 Apache. 2 Module - Apache ♦ Overview This module focuses on configuring and customizing Apache web server. Apache is a commonly used Hypertext Transfer.
INFSOM-RI Juelich, 10 June 2008 ETICS - Maven From competition, to collaboration.
July 2011CMSC 341 CVS/Ant 1 CMSC 341 Java Packages Ant CVS Project Submission.
Ant & Jar Ant – Java-based build tool Jar – pkzip archive, that contains metadata (a manifest file) that the JRE understands.
Overview of the Automated Build & Deployment Process Johnita Beasley Tuesday, April 29, 2008.
Software Development COMP220/COMP285 Seb Coope Introducing Ant These slides are mainly based on “Java Development with Ant” - E. Hatcher & S.Loughran.
Chapter 1 Introducing Ant. What is ant? Ant is a build tool  Automate the tasks of compiling code, running test, and packaging the results for redistribution.
Maven for building Java applications By Nalin De Zoysa
Enterprise Java v090125Dev Env Overview1 Enterprise Java ( ) Development Environment Overview.
Ant / continuous integration. Turning Client Vision into Results 2 Outline presentation Introduction Ant –History –Concepts –Tasks –Examples –Extending.
Apache m aven Introduction to. Juven Xu twitter.com/juvenxu.
Build Systems Presentation December 14, 2015 Noon-1pm Kathy Lee Simunich Bldg. 203/ D120 Brought to you by: Argonne Java.
Software Deployment & Release 26/03/2015 1EN-ICE.
8/29/10 Maven Repository Management with Nexus Jim McMahon.
Maven. Introduction Using Maven (I) – Installing the Maven plugin for Eclipse – Creating a Maven Project – Building the Project Understanding the POM.
CS520 Web Programming Introduction to Maven Chengyu Sun California State University, Los Angeles.
An Introduction to Ant. What is Ant? How do you use it? Why would you want to?
Maven and Jelly James Strachan. Introduction Maven and Jelly are both Apache projects at Jakarta Ultimately both will be top.
Maven & NetBeans Platform. Agenda ● Maven NetBeans Platform Project Types ● Three NetBeans RCP project types ● Differences with Ant project types ● All.
Platform & Maven2 David Šimonek. Certified Engineer Course Agenda What is Maven? Why Maven? NB IDE & Maven NB Platform & Maven.
SharePoint 101 – An Overview of SharePoint 2010, 2013 and Office 365
Agenda:- DevOps Tools Chef Jenkins Puppet Apache Ant Apache Maven Logstash Docker New Relic Gradle Git.
Open-O Integration Project Introduction
Maven 04 March
CS520 Web Programming Introduction to Maven
Build Automation with Gradle
Plan What is Maven ? Links : mvn command line tool
Test Driven Development
Brian Leonard ブライアン レオナルド
prepared by hasan.we4tech.com
Project management and comprehension tool
Advanced Integration and Deployment Techniques
Chengyu Sun California State University, Los Angeles
Zlatko Stamatov JavaSkop 13 December 2015
Maven IIB9 Plug-in Version 9.0
Ant.
ESIS Consulting LLC (C) ESIS Consulting LLC. All rights reserved
Brian Kotek INDUS Corporation
Maven IIB9 Plug-in Version 9.0
Escidoc build and development environment
Nilanjan Banerjee Java Packages Ant CVS Project Submission
CS4961 Software Design Laboratory Understand Aquila Backend
Continuous Integration
Software Engineering and Architecture
Presentation transcript:

Bhavana Sudharshan Jaydeep Patel APACHE MAVEN Bhavana Sudharshan Jaydeep Patel

Introduction What is Maven? “Maven is a software management and comprehension tool based on the concept of Project Object Model (POM) which can manage project build, reporting, and documentation from a central piece of information” What is POM? “As a fundamental unit of work in Maven, POM is an XML file that contains information about project and configuration details used by Maven to build the project” History: Jakarta Turbine Project

Objectives and Characteristics of MAVEN Maven is more than just Build Tool Maven was built considering certain objectives Maven Provides: Easy Build Process Uniform Build System Quality Project Information Guidelines for Best Practices Development Achieved Characteristics: Visibility Reusability Maintainability Comprehensibility “Accumulator of Knowledge”

Comparison with ANT One level above ANT Higher level of reusability between builds Faster turn around time to set up a powerful build Project website generation Less maintenance Greater momentum Repository management Automatic downloads ANT MAVEN Target build.xml Goal pom.xml Higher level of reusability between builds Faster turn around time to set up a powerful build (once you're used to Maven) Less maintenance Shared build meme. I know how to build any maven project Greater momentum: Ant is now legacy and not moving fast ahead. Maven is forging ahead fast and there's a potential of having lots of high-value tools around Maven (CI, Dashboard project, IDE integration, etc).

Main Features of MAVEN Build-Tool Dependency Management Tool Documentation Tool

Overview of Simple Architecture A repository in Maven is used to hold build artifacts and dependencies of varying types The local repository refers to a copy on your own installation that is a cache of the remote downloads, and also contains the temporary build artifacts that you have not yet released. Remote repositories refer to any other type of repository, accessed by a variety of protocols such as file:// and http://. These repositories might be a truly remote repository set up by a third party to provide their artifacts for downloading

Project Creation in MAVEN mvn archetype:generate -DgroupId = com.mycompany.app -DartifactId = my-app -DarchetypeArtifactId = maven-archetype-quickstart -DinteractiveMode = false The prefix archetype is the plugin that contains the goal . similar to a task in ant.

Contents of the Created Project POM source tree for your application's sources source tree for your test sources

POM.XML <project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion> 4.0.0 </modelVersion> <groupId> com.mycompany.app </groupId> <artifactId> my-app </artifactId> <packaging> jar </packaging> <version> 1.0-SNAPSHOT </version> <name> Maven Quick Start Archetype </name> <url> http://maven.apache.org </url> <dependencies> <dependency> <groupId> junit </groupId> <artifactId> junit </artifactId> <version> 4.8.2 </version> <scope> test </scope> </dependency> </dependencies> </project>

BUILD.XML <project default = "compile"> <property name = "classesdir = " " value = "..."/> <property name = "libdir" value = "..."/> <target name = "compile"> <mkdir dir = "${classesdir}"/> <javac destdir = "${classesdir}"> <src> <pathelement location = "src/main/java"/> </src> <classpath> <fileset dir = "${libdir}"> <include name = "*.jar"/> </fileset> </classpath> </javac> </target> </project> By following the standard Maven conventions you can get a lot done with very little effort! Just as a casual comparison, let's take a look at what you might have had to do in Ant to accomplish the same thing. Now, this is simply to compile a single tree of application sources and the Ant script shown is pretty much the same size as the POM shown above. But we'll see how much more we can do with just that simple POM! There is far more functionality available to you from Maven without requiring any additions to our POM as it currently stands. To get any more functionality out of our example Ant build file you must keep making error-prone additions. So what else can you get for free? There are a great number of Maven plug-ins that work out of the box with even a simple POM like we have above. We'll mention one here specifically as it is one of the highly prized features of Maven: without any work on your part this POM has enough information to generate a web site for your project! You will most likely want to customize your Maven site but if you're pressed for time all you need to do to provide basic information about your project is execute the following command:

Project Object Model (POM) Metadata: Location of Directories, Developers/Contributors, Dependencies, Repositories Dependencies (Transitive Dependencies), Inheritance, and Aggregation Key Elements Project Model Version Group ID Packaging Artifact ID Version Name URL Description project This is the top-level element in all Maven pom.xml files. modelVersion This element indicates what version of the object model this POM is using. The version of the model itself changes very infrequently but it is mandatory in order to ensure stability of use if and when the Maven developers deem it necessary to change the model. groupId This element indicates the unique identifier of the organization or group that created the project. The groupId is one of the key identifiers of a project and is typically based on the fully qualified domain name of your organization. For example org.apache.maven.plugins is the designated groupId for all Maven plug-ins. packaging This element indicates the package type to be used by this artifact (e.g. JAR, WAR, EAR, etc.). This not only means if the artifact produced is JAR, WAR, or EAR but can also indicate a specific lifecycle to use as part of the build process. (The lifecycle is a topic we will deal with further on in the guide. For now, just keep in mind that the indicated packaging of a project can play a part in customizing the build lifecycle.) The default value for the packaging element is JAR so you do not have to specify this for most projects. artifactId This element indicates the unique base name of the primary artifact being generated by this project. The primary artifact for a project is typically a JAR file. Secondary artifacts like source bundles also use the artifactId as part of their final name. A typical artifact produced by Maven would have the form <artifactId>-<version>.<extension> (for example, myapp-1.0.jar). version This element indicates the version of the artifact generated by the project. Maven goes a long way to help you with version management and you will often see the SNAPSHOT designator in a version, which indicates that a project is in a state of development. We will discuss the use of snapshots and how they work further on in this guide. name This element indicates the display name used for the project. This is often used in Maven's generated documentation. url This element indicates where the project's site can be found. This is often used in Maven's generated documentation. description This element provides a basic description of your project. This is often used in Maven's generated documentation

Standard Directory Layout src/main/java Application/Library sources src/main/resources Application/Library resources src/main/filters Resource filter files src/main/assembly Assembly descriptors src/main/config Configuration files src/main/scripts Application/Library scripts src/main/webapp Web application sources src/test/java Test sources src/test/resources Test resources src/test/filters Test resource filter files src/site Site LICENSE.txt Project's license NOTICE.txt Notices and attributions required by libraries that the project depends on README.txt Project's readme If you were to create a Maven project by hand this is the directory structure that we recommend using.Having a common directory layout would allow for users familiar with one Maven project to immediately feel at home in another Maven project. The advantages are analogous to adopting a site-wide look-and-feel.

Dependency Management <dependencies> <dependency> <groupId>com.acme</groupId> <artifactId>B</artifactId> <version>[1.0,)</version> <scope>compile</scope> </dependency> </dependencies> « Any Version After 1.0 » Artifact Repository (Local) Build C Repositories (Remote) Look for A & B

Dependency Management

Transitive Dependencies Allows automatically inclusion of libraries Avoids the need to discover and specify the required libraries that your own

Documentation – Building Own Site mvn site pom.xml <project> ... <distributionManagement> <site> <id>website</id> <url>scp://www.mycompany.com/www/docs/project/</url> </site> </distributionManagement> ... </project> mvn site-deploy

Report Generation

Sources http://maven.apache.org/ http://code.google.com/p/agilepractice/ http://www.sonatype.com/books/mvnref-book/reference/site-generation-sect-building.html