Jump to content
xisto Community
Sign in to follow this  
j44p

Short Info About About Apache Maven. Its a brief description about Apache Maven and how does it woks.

Recommended Posts

Hi there.

Well, it's my first post and I'd like to write about Apache Maven: What is it? How does it works? and a short example.

I hope this post results interesting and useful for someone, and well. Let's start.!

What is Apache Maven?

Apache Maven(or simple Maven) is a helpful tool design to create and build projects (usually Java Projects) almost in the same way than Ant and the classic "GnuMake", but Maven goes beyond and incorporate some another concepts like: archetypes, build cycles and plug-ins

For those who had use Ant, the way you build and use Maven would result very intuitive, at lest in the way you use it.

How does it work? and a short example

Maven is an executable .jar file and often the only thing to install it is download the .tgz untar the distribution archive and add it to the classpath.

The next step is to achieve one file named pom.xml who's the basic unit for configure and create a complete project in maven.

A simple pom.xml would be:
 



<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 [url="https://maven.apache.org/xsd/maven-4.0.0.xsd"]http://maven.apache.org/xsd/maven-4.0.0.xsd">[/url] <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>3.8.1</version> <scope>test</scope> </dependency> </dependencies></project>

Whit this file in our base folder we are ready for use maven:
 



$> mvn package

and the output:
 



[INFO] ------------------------------------------------------------------------[INFO] ------------------------------------------------------------------------[INFO] BUILD SUCCESSFUL[INFO] ------------------------------------------------------------------------[INFO] Total time: 9 seconds[INFO] Finished at: Mon Aug 18 13:15:38 CDT 2008[INFO] Final Memory: 18M/75M[INFO] ------------------------------------------------------------------------

Means that maven is working fittingly. :)

Finally:

If you want you can visit the 5 minuts tutorial form the Apache Project:

http://forums.xisto.com/no_longer_exists/

Next days I'll update this post for show you how to build a simple application and how and where to find archetypes.

See you!



Edited by OpaQue (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.