Thursday, February 28, 2013

Creating a Maven Project Site

Maven is more than just a build tool. It's also a project management tool, dependency manager, a standards informer, and much more. As a project management tool, one of the things you can do is create a project website to track project dependencies, issues, manage the development team, etc.

If you don't have a Maven project created yet, go to my tutorial on Creating a Maven Project in Eclipse. Now that you have a project to work with, open a command prompt and go to the root directory of your project, where your pom.xml file is located. Type "mvn site:run" at the command prompt and hit Enter. You'll see a bunch of JARs downloaded and eventually a message saying "Starting Jetty on http://localhost:8080/".



You can now view your project website by going to http://localhost:8080/ in your web browser.


On the left menu, you'll see a number of links to information about your project, such as the project team, issue tracking, dependencies, etc. Outside of the things that Maven can infer from your pom.xml file, such as dependencies, there isn't much information on the site yet. All of this information must be configured in your pom.xml file. Things such as issue tracking are pulled from your bug tracking tool (e.g. Bugzilla). Static information, such as the name of the project, the project team, and the developers are all things that you can just add as static content to your pom.xml file. I won't go through all of these things in this tutorial, but to get an idea how it works, you can add the following information to your pom.xml file within your <project> element to list your development team.

<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">
...
  <developers>
    <developer>
      <id>travis</id>
      <name>Travis</name>
      <email>travisdazell@gmail.com</email>
      <url>http://travisdazell.blogspot.com</url>
      <organization>Travis</organization>
      <organizationUrl>http://travisdazell.blogspot.com</organizationUrl>
      <roles>
        <role>Architect</role>
        <role>Developer</role>
      </roles>
      <timezone>-6</timezone>
      <properties>
      </properties>
    </developer>
  </developers>
...
</project>

No comments:

Post a Comment