Section 4.9. Announcing a Project Release


4.9. Announcing a Project Release

You have deployed your artifacts to a Maven remote repository. Now you need to announce this fact to your project stakeholders.

4.9.1. How do I do that?

Use the Announcement plug-in. If you've been following the practice of using a changes.xml file to describe your project changes, as demonstrated earlier, this will be very easy. If not, you're out of luck, as the Announcement plug-in works hand in hand with the Changes plug-in.

In this lab you'll generate a release announcement for the qotd/core subproject, which will allow you to reuse the changes.xml file you added in a previous lab.

Decide for what release you want to generate the announcement. If you don't configure anything, an announcement for the current version defined in the POM will be generated. You can control this through the maven.announcement.version property, which defaults to:

maven.announcement.version = ${pom.currentVersion}

The Announcement plug-in makes one check: it verifies that there is a version tag in the POM that matches the release for which you wish to generate the announcement. A version tag indicates that a release has been made, and it's also meant to link the release with the SCM tag that you've used. It's indeed good practice to tag your SCM when performing a software release. Let's imagine that you've already released version 0.9 of the core project. Add the following version information to qotd/core/project.xml:

[...]   </repository>      <versions>     <version>       <id>0.9</id>       <name>0.9</name>       <tag>QOTD_CORE_0_9</tag>     </version>   </versions>  [...]

Note that the name element is simply a friendly name for the id tag. It can be whatever you like.

Generate the announcement for release 0.9 by running maven announcement:generate (note that we're passing a property on the command line):

C:\dev\mavenbook\code\reporting\core>maven announcement:generate ^ More? -Dmaven.announcement.version=0.9 [...] announcement:generate:     [echo] Generating announcement for release 0.9 in C:\dev\mavenbook\code\reporting\ core/target/generated-xdocs/announcements/ announcement-0.9.txt...     [echo] Using stylesheet located at file:C:\Documents and Settings\Vincent Massol\ .maven\cache\maven-announcement-plugin-1.3\pl ugin-resources/announcement.jsl and UTF-8 encoding BUILD SUCCESSFUL

You can find the generated announcement in target/generated-xdocs/announcements/announcement-0.9.txt:

The mdn team is pleased to announce the QOTD Core 0.9 release!     http://www.mavenbook.org/projects/mdn/qotd-core    QOTD Core library     Changes in this version include:      New Features:    o Initial release. See the features page for more details.       Fixed bugs:    o The changelog report now works with Subversion. Issue: QOTDCORE-1.      Have fun! -The mdn team

As you can see, the Announcement plug-in generated this text by gathering information from the POM and from the core/changes.xml file:

[...]     <release version="0.9" date="2005-03-22" description="Initial release">       <action dev="vmassol" type="fix" issue="QOTDCORE-1">         The changelog reports now works with Subversion.       </action>       <action dev="vmassol" type="add">         Initial release. See the features page for more details.       </action>     </release>   </body> </document>

4.9.2. What about...

...sending this announcement by email?

You can do that using the announcement:mail goal. At a minimum you'll need to tell the plug-in what SMTP server to use and to whom to send the email. You specify the SMTP server by adding the following property in your build.properties file (this is indeed a property that depends on your environment and may or may not be shared with others):

maven.announcement.mail.server = my_smtp_server

The recipients are defined using the maven.announcement.mail.to property. For example:

maven.announcement.mail.to = users@mavenbook.org,dev@mavenbook.org

The plug-in will compute the email sender by looking at the developers section of the POM and will use the email of the first developer it finds, unless you have specified a sender using the maven.announcement.mail.from property. Several other optional properties exist; you can find them online at http://maven.apache.org/reference/plugins/announcement/properties.html.



Maven. A Developer's Notebook
Maven: A Developers Notebook (Developers Notebooks)
ISBN: 0596007507
EAN: 2147483647
Year: 2003
Pages: 125

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net