Hi Ringo,
You will need to set the properties on the project object.
To get a project injected into your MOJO:
/**
* The Maven project instance for the executing project.
*
* <p>Note: This is passed by Maven and must not be configured by
the user.</p>
*
* @parameter expression="${project}"
* @required
*/
private MavenProject project;
then, to set a property, you could try:
project.getProperties().put("key", "value");
Cheers,
Nick
On 06/02/2009, at 11:05 PM, De Smet Ringo wrote:
Hello,
I have a custom mojo that calculates the values for the properties
releaseVersion and developmentVersion of the maven-release-plugin. I
would like to invoke the release as follows:
mvn telenet:getNextVersion release:prepare
How should I define these properties so the release plugin picks
them up? Defining them using System.setProperty doesn't seem to
work. Got a suggestion?
Here is a transcript of my Maven output:
C:\Workspace\common>mvn telenet:getNextVersion release:prepare -
DgenerateReleasePoms=true
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'telenet'.
[INFO]
------------------------------------------------------------------------
[INFO] Building common
[INFO] task-segment: [telenet:getNextVersion]
[INFO]
------------------------------------------------------------------------
[INFO] [telenet:getNextVersion]
[INFO] Setting releaseVersion to 9.10.6
[INFO] Setting developmentVersion to 9.10-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[INFO] Building common
[INFO] task-segment: [release:prepare] (aggregator-style)
[INFO]
------------------------------------------------------------------------
[INFO] [release:prepare]
...
However, not version 9.10.6 is built, but just version 9.10.
Ringo
*************************************************************
Dit e-mail bericht inclusief eventuele ingesloten bestanden kan
informatie bevatten die vertrouwelijk is en/of beschermd door
intellectuele eigendomsrechten. Dit bericht is uitsluitend bestemd
voor de geadresseerde(n). Elk gebruik van de informatie vervat in
dit bericht (waaronder de volledige of gedeeltelijke reproductie of
verspreiding onder elke vorm) door andere personen dan de
geadresseerde(n) is verboden. Indien u dit bericht per vergissing
heeft ontvangen, gelieve de afzender hiervan te verwittigen en dit
bericht te verwijderen.
This e-mail and any attachment thereto may contain information which
is confidential and/or protected by intellectual property rights and
are intended for the sole use of the addressees. Any use of the
information contained herein (including but not limited to total or
partial reproduction or distribution in any form) by other persons
than the addressees is prohibited. If you have received this e-mail
in error, please notify the sender and delete its contents.
Ce courriel et les annexes éventuelles peuvent contenir des
informations confidentielles et/ou protégées par des droits de
propriété intellectuelle. Ce message est adressé exclusivement à son
(ses) destinataire(s). Toute utilisation du contenu de ce message (y
compris la reproduction ou diffusion partielle ou complète sous
toute forme) par une autre personne que le(s) destinataire(s) est
formellement interdite. Si vous avez reçu ce message par erreur,
veuillez prévenir l'expéditeur du message et en détruire le contenu.
*************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org