Nice TWiki > Doc > DevelopmentTools > MavenGuide (r1.5) TWiki webs:
Dev | Doc | Main | TWiki | Sandbox
Doc . { Changes | Index | Search | Go }
Maven is a project management tool. Based on a single file defining your project, it is able to automatically build your program (tracking its dependencies), and generate a website with souce documentation, test results, change logs, ...

Nice is being integrated with Maven. This means that you can use Maven to manage your project that include Nice sources. This system will probably be used to distribute Nice libraries in the future, which will make using existing Nice libraries in your programs even easier, since Maven can download them automatically.

Installation

The first thing you need to do is to download Maven. You then need to make Maven aware of the repository that contains the Nice plugin. To do this, you should create a file build.properties in your home directory (~/build.properties on Unix systems, C:\Documents and Settings\YourUserName\build.properties on Windows systems). This file only need one line, which is the following:

maven.repo.remote = http://nice.sf.net/maven,http://www.ibiblio.org/maven

The ibiblio.org server is the main Maven repository.

Your version of Maven is now able to handle Nice sources!

Usage

At the root directory of your project, you should create a file project.xml. There is lots of information that can be filled and that will be used by the various plugins. Here is a minimalistic example that focus on building a Nice project.

<?xml version="1.0"?>
<project>
  <pomVersion>3</pomVersion>
  <name>Maven test</name>
  <id>maven-test</id>
  <currentVersion>0.1</currentVersion>
  <inceptionYear>2004</inceptionYear>
  <package>maven.test</package>

  <shortDescription>Maven test project</shortDescription>

  <description>
    This a simple Nice project, built with Maven.
  </description>

  <developers>
    <developer>
      <name>Your Name</name>
      <id>yourid</id>
      <email>your@email.address</email>
    </developer>
  </developers>

   <dependencies>
    <dependency>
      <groupId>nice</groupId>
      <artifactId>maven-nice-plugin</artifactId>
      <type>plugin</type>
      <version>SNAPSHOT</version>
    </dependency>
  </dependencies>
                                                                                
  <build>
    <sourceDirectory>src</sourceDirectory>
  </build>

</project>

You can build this project by simply typing maven nice.

Other useful command are:

maven clean Erase all the generated files
maven site:generate Generate a website that documents the project
maven site:deploy Publish the website on a web server
maven -g List all commands

See the documentation for general information about how to use Maven.

Known issues

For the generation of the website, javadoc will fail if there is not any Java source file in the source tree. Until we manage to use NiceDoc instead, a workaround is to add a dummy Java. (This is fixed in the CVS version of maven)

-- DanielBonniot - 30 Jan 2004

Topic MavenGuide . { Edit | Attach | Ref-By | Printable | Diffs | r1.8 | > | r1.7 | > | r1.6 | More }
Revision r1.5 - 15 Feb 2004 - 13:57 GMT - DanielBonniot
Parents: WebHome > DevelopmentTools
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.