Over a million developers have joined DZone.

Adding a Site to your Maven Project

DZone's Guide to

Adding a Site to your Maven Project

· Java Zone
Free Resource

Just released, a free O’Reilly book on Reactive Microsystems: The Evolution of Microservices at Scale. Brought to you in partnership with Lightbend.

Once you’ve got your Maven project built and sorted, one of the neat tricks you can do to make it look even more professional is to add a Maven Site. Maven gives you the ability to add a whole site structure with one simple command.

mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes

…where all the above is on one line. This will add the following directory structure in to your project's src directory.

Generating the site from these files and pushing it into your target directory is then simply a matter of issuing the following Maven command:

mvn clean site

…and that’s all there is to it. If you open the target/site/index.html file in your browser, you’ll see something like this:

Of course there’s the little matter of adding some content and publishing it to a server somewhere, but that’s a matter for another blog.


From http://www.captaindebug.com/2011/11/adding-site-to-your-maven-project.html

Strategies and techniques for building scalable and resilient microservices to refactor a monolithic application step-by-step, a free O'Reilly book. Brought to you in partnership with Lightbend.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}