You have published project releases. Now would be a good time to discover how to let your users know where to find them. Let's add a release report to the project web site.
The XDoc plug-in has a nice feature: it can generate a download report listing all past
releases, with a link to the artifacts and the release announcements.
Let's use it on the QOTD packager
project. The packager
is the
project that generates the main QOTD distributable, so it makes sense
to have it generate the download report.
First, tell the XDoc plug-in where the artifacts are published.
You do this by using the maven.xdoc.distributionUrl
property. Add it
to the qotd/packager/project.properties
file:
maven.xdoc.distributionUrl=http://www.mavenbook.org/maven/mdn/zips/
The distribution URL is an important piece of information
missing from the POM. It will be added in the near future. The XDoc
plug-in needs information about the releases that have been made. It
gets this information from the POM by scanning the version
tags. Let's imagine that you've
already released versions 0.7, 0.8, and 0.9 of the packager
project. Add the following version
information to qotd/packager/project.xml:
[...] </repository> <versions> <version> <id>0.7</id> <name>0.7</name> <tag>QOTD_PACKAGER_0_7</tag> </version> <version> <id>0.8</id> <name>0.8</name> <tag>QOTD_PACKAGER_0_8</tag> </version> <version> <id>0.9</id> <name>0.9</name> <tag>QOTD_PACKAGER_0_9</tag> </version> </versions> [...]
You saw in the previous lab that the Announcement plug-in can
generate announcement reports. It would be nice to add them to the
download report so that users who want to download your software can
know what the download contains. The download report will
automatically add the announcement reports if the XDoc plug-in can
find a changes.xml file with
releases matching the version
tags
of the POM. Add one to qotd/packager/xdocs/changes.xml:
<?xml version="1.0" encoding="UTF-8"?> <document> <properties> <title>Changes</title> </properties> <body> <release version="1.0-SNAPSHOT" date="in SVN"> [...] </release> <release version="0.9" date="2005-03-22"> [...] </release> <release version="0.8" date="2005-03-10"> [...] </release> <release version="0.7" date="2005-03-01"> [...] </release> </body> </document>
You're all set! Reap the fruits of your hard labor by typing
maven site
. It'll generate a
download report, as shown in Figure 4-16.
Note that there is a visible Downloads link in the left menu that draws the attention of visitors.
...having a Downloads link on the master QOTD web site?
Yes, you're right, the Downloads link in the packager
project is nice, but it isn't very visible for visitors who will
arrive on the top-level site. The solution is to write a qotd/xdocs/downloads.xml XDoc document
linking to the different subprojects' download reports. Indeed, it's
possible that several subprojects produce distributable artifacts and
this solution allows you to list them all on the main downloads.xml page.
Get Maven: A Developer's Notebook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.