thenewguy
thenewguy

Reputation: 61

What is a "site" that is created when running the maven site command?

I am new to java and working in a project managed by maven. This is a basic question so I'm sorry, but I like to become familiar with all the terminology. When I google the question it is answered by stating that maven creates a site. What kind of site? What specifically is meant by that?

Upvotes: 5

Views: 3205

Answers (2)

catch32
catch32

Reputation: 18612

Maven's site - is a command for generating documentation for your project. Later after the build is finished you could open it in the browser and navigate to different parts of it. All sources are generated into target folder.

For running this command you have to add the site plugin to your pom file first. Otherwise, the build failed.

The Maven site lifecycle has two phases bound to the goals of the site plugin by default: the site phase is bound to the site goal, and the site-deploy phase is bound to the deploy goal.

Here are the descriptions of those goals:

  • site – generate a site for a single project; the generated site only shows information about the artefacts specified in the POM

  • deploy – deploy the generated site to the URL specified in the distributionManagement element of the POM

In addition to the site and deploy, the site plugin has several other goals to customize the content of the generated files and to control the deployment process.

Useful links:

Upvotes: 0

Ken Chan
Ken Chan

Reputation: 90517

It simply means that Maven can generate a website for your project and release it to the public based on the pom.xml 's configuration. Internally, it uses Maven Site Plugin to do it.

A real life example is the JUnit4 web site. Given this pom.xml, it will then generate this web site.

Upvotes: 7

Related Questions