Maven
Upcoming SlideShare
Loading in...5
×
 

Maven

on

  • 3,299 views

Tutorials for how to use maven as a build script.

Tutorials for how to use maven as a build script.

Statistics

Views

Total Views
3,299
Views on SlideShare
2,792
Embed Views
507

Actions

Likes
2
Downloads
69
Comments
0

17 Embeds 507

http://ravireddyjsf.blogspot.com 234
http://www.ravireddyjsf.blogspot.com 147
http://ravireddyjsf.blogspot.in 55
http://ravireddyjsf.blogspot.ru 22
http://www.ravireddyjsf.blogspot.in 20
http://ravireddyjsf.blogspot.co.uk 11
http://www.linkedin.com 3
http://www.ravireddyjsf.blogspot.fr 2
http://ravireddyjsf.blogspot.com.es 2
http://www.ravireddyjsf.blogspot.com.br 2
http://ravireddyjsf.blogspot.de 2
http://ravireddyjsf.blogspot.fr 2
http://ravireddyjsf.blogspot.co.nz 1
http://ravireddyjsf.blogspot.com.br 1
http://ravireddyjsf.blogspot.nl 1
http://ravireddyjsf.blogspot.sg 1
http://ravireddyjsf.blogspot.ca 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Maven Maven Presentation Transcript

  • Apache Maven
  • Apache Maven
    • This presentation to illustrate how to use maven for build scripts
    • It always difficult for developers where and how to start a simple example to understand to write maven script for the projects.
    • I try to show in this presentation how we can leverage the maven for build scripts.
    • If you unable to follow or understand the process, Please do contact me at below details.
    • E-mail: [email_address]
    • www.ravireddyjsf.blogspot.com
    • Ravi Reddy ( [email_address] )
  • Apache Maven
    • Java Project
    • We start to build a simple jar for a Java project in Eclipse IDE
      • Create a simple MavenJavaDemo java project in the eclipse make sure your project structure (circled in red color) and build path should look similar shown in below figures.
  • Apache Maven
    • POM.xml
    • <project xmlns= &quot;http://maven.apache.org/POM/4.0.0&quot;
    • xmlns:xsi= &quot;http://www.w3.org/2001/XMLSchema-instance&quot;
    • xsi:schemaLocation= &quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot; >
    • <modelVersion>4.0.0</modelVersion>
    • <groupId>ravi-demos.com.maven.demo</groupId>
    • <artifactId>MavenJavaDemo</artifactId>
    • <packaging>jar</packaging>
    • <version>0.0.1-SNAPSHOT</version>
    • <name>Example for build script- Maven </name>
    • <description>Example to create a build script using maven </description>
    • <!-- Add Java 1.6 plugin -->
    • <build>
    • <plugins>
    • <plugin>
    • <groupId>org.apache.maven.plugins</groupId>
    • <artifactId> maven -compiler- plugin </artifactId>
    • <configuration>
    • <source>1.6</source>
    • <target>1.6</target>
    • </configuration>
    • </plugin>
    • </plugins>
    • </build>
    • </project>
  • Apache Maven
    • Web Application Project
    • In this tutorial we build a simple *.war file for a Web application project in Eclipse IDE
    • Create a simple MavenWebAppDemo java project in the eclipse make sure your project structure (circled in red color) and build path should look similar shown in below figures.
  • Apache Maven
    • POM.xml
      • <project xmlns= &quot;http://maven.apache.org/POM/4.0.0&quot;
      • xmlns:xsi= &quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      • xsi:schemaLocation= &quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot; >
      • <modelVersion>4.0.0</modelVersion>
      • <groupId>ravi-demos.com.maven.demo</groupId>
      • <artifactId>MavenWebAppDemo</artifactId>
      • <packaging>war</packaging>
      • <name>Example for maven build script for web app </name>
      • <version>0.0.1-SNAPSHOT</version>
      • <description>Example for maven build script for web application</description>
      • <!-- Adding dependency jars required for the project. -->
      • <dependencies>
      • <dependency>
      • <groupId>javax.servlet</groupId>
      • <artifactId> servlet - api </artifactId>
      • <version>2.4</version>
      • <scope>provided</scope>
      • </dependency>
      • </dependencies>
      • <build>
      • <plugins>
      • <plugin>
      • <groupId>org.apache.maven.plugins</groupId>
      • <artifactId> maven -war- plugin </artifactId>
      • <configuration>
  • Apache Maven
    • <webResources>
    • <resource>
      • <directory>${ basedir }/ src /main/java</directory>
      • <targetPath>WEB-INF/classes</targetPath>
      • <includes>
      • <include>**/*.properties</include>
      • <include>**/*. xml </include>
      • <include>**/*. jsp </include>
      • </includes>
      • </resource>
    • </webResources>
    • </configuration>
    • </plugin>
    • <plugin>
    • <artifactId> maven -compiler- plugin </artifactId>
    • <configuration>
    • <source>1.6</source>
    • <target>1.6</target>
    • </configuration>
    • </plugin>
    • </plugins>
    • </build>
    • </project>
  • Apache Maven
    • Enterprise (EAR) Application Project
    • In this tutorial we build a simple *.ear file for a Enterprise application project in Eclipse IDE
    • Create a simple MavenEarDemo java project in the eclipse make sure your project structure (circled in red color) and build path should look similar shown in below figures.
  • Apache Maven
    • POM.xml
    • <project xmlns= &quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi= &quot;http://www.w3.org/2001/XMLSchema-instance&quot;
    • xsi:schemaLocation= &quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot; >
    • <modelVersion>4.0.0</modelVersion>
    • <groupId>ravi-demos.com.maven.demo</groupId>
    • <artifactId>MavenEarDemo</artifactId>
    • <packaging>ear</packaging>
    • <name>Example for maven build script for ear app</name>
    • <version>0.0.1-SNAPSHOT</version>
    • <description>Example for build script for ear application</description>
    • <!-- Adding dependency jars required for the project. -->
    • <dependencies>
    • <!-- Web module to be bundled in EAR -->
      • <dependency>
      • <groupId>ravi-demos.com.maven.demo</groupId>
      • <artifactId>MavenWebAppDemo</artifactId>
      • <version>0.0.1-SNAPSHOT</version>
      • <type>war</type>
      • </dependency>
      • <!-- EJB/Jar module to be bundled in EAR -->
      • <dependency>
      • <groupId>ravi-demos.com.maven.demo</groupId>
      • <artifactId>MavenJavaDemo</artifactId>
      • <version>0.0.1-SNAPSHOT</version>
      • <scope>provided</scope>
      • </dependency>
    • </dependencies>
  • Apache Maven
    • <build>
    • <plugins>
      • <plugin>
      • <groupId>org.apache.maven.plugins</groupId>
      • <artifactId>maven-ear-plugin</artifactId>
      • <configuration>
      • <manifestFile>src/main/application/META-INF/MANIFEST.MF</manifestFile>
      • <earSourceDirectory>src/main/application/</earSourceDirectory>
      • <earSourceExcludes>META-INF/MANIFEST.MF</earSourceExcludes>
      • <modules>
        • <webModule>
        • <groupId>ravi-demos.com.maven.demo</groupId>
        • <artifactId>MavenWebAppDemo</artifactId>
        • <contextRoot>/MavenWebAppDemo-0.0.1-SNAPSHOT</contextRoot>
        • <bundleFileName>MavenWebAppDemo-0.0.1-SNAPSHOT.war</bundleFileName>
        • </webModule>
      • </modules>
      • </configuration>
      • </plugin>
      • <plugin>
      • <artifactId>maven-compiler-plugin</artifactId>
      • <configuration>
      • <source>1.6</source>
      • <target>1.6</target>
      • </configuration>
      • </plugin>
    • </plugins>
    • </build>
    • </project>