HOME       >>       Programming

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


j44p

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!





VIEW DESKTOP VERSION REGISTERGET FREE HOSTING

Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.