maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason van Zyl <jvan...@sonatype.com>
Subject Re: Recording build environment
Date Fri, 27 Mar 2009 15:30:37 GMT

On 27-Mar-09, at 7:09 AM, Nord, James wrote:

> What would be the solution for Maven 3? I currently have a plug-in  
> that
> does exactly what you describe.
>

It wouldn't change, a plugin is the way to go if you want to collect  
information which currently is an arbitrary set of information.

> /**
> * Goal which stores the maven core version in a property
> <code>maven.version</code>.
> *
> * @goal getVersion
> * @phase validate
> * @author James Nord
> */
> public class MavenVersionMojo extends AbstractMojo {
>
> 	private final static String VERSION_PROPERTY = "maven.version";
>
> 	/**
> 	 * The Maven project.
> 	 *
> 	 * @parameter expression="${project}"
> 	 * @required
> 	 * @readonly
> 	 */
> 	private MavenProject        project;
>
> 	/**
> 	 * @component
> 	 */
> 	private RuntimeInformation  runtime;
>
>
> 	public void execute() throws MojoExecutionException {
> 		ArtifactVersion mavenVersion =
> runtime.getApplicationVersion();
> 		getLog().debug("retrieved maven version: " +
> mavenVersion.toString());
> 		if (project != null) {
> 			project.getProperties().put(VERSION_PROPERTY,
> mavenVersion.toString());
> 		}
> 	}
> 	
> }
>
>
>> -----Original Message-----
>> From: Brett Porter [mailto:brett@apache.org]
>> Sent: 25 March 2009 23:29
>> To: Maven Developers List
>> Subject: Re: Recording build environment
>>
>> I don't think so, but you can get your hands on the
>> RuntimeInformation.ROLE component. Bear in mind it will
>> almost certainly cause your plugin to get broken in Maven 3.0 though.
>>
>> - Brett
>>
>> On 26/03/2009, at 6:20 AM, Paul Gier wrote:
>>
>>> That's true, I can get the OS and Java version from standard
>>> properties, and then put them in the Manifest or somewhere
>> else.  Is
>>> there a property that contains the current running version of maven?
>>>
>>> Brian E. Fox wrote:
>>>> It seems like if there were some properties available, or known to
>>>> the resources plugin, then you could filter these values
>> in anywhere
>>>> you wanted them.
>>>> -----Original Message-----
>>>> From: Paul Gier [mailto:pgier@redhat.com] Sent: Wednesday,
>> March 25,
>>>> 2009 11:54 AM
>>>> To: Maven Developers List
>>>> Subject: Recording build environment
>>>> I'd like to be able to record the build environment (maven
>> version,
>>>> java, OS, etc) for each build that is run in a standard way.  I
>>>> originally created a jira issue in the release plugin
>> (MRELEASE-352)
>>>> to record information just for releases.  But now I'm
>> thinking that
>>>> this could be useful for any build.
>>>> I'd just like to get a few other opinions about this
>> before working
>>>> on it.  Is there any existing plugin that might be a good fit for
>>>> this type of functionality?  Or should it be a new plugin?
>> Or would
>>>> this type of thing be better handled by something like Hudson?
>>>> Thanks!
>>>>
>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For
>>>> additional commands, e-mail: dev-help@maven.apache.org
>>>>
>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For
>>>> additional commands, e-mail: dev-help@maven.apache.org
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For
>>> additional commands, e-mail: dev-help@maven.apache.org
>>>
>>
>> --
>> Brett Porter
>> brett@apache.org
>> http://blogs.exist.com/bporter/
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For
>> additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
> **************************************************************************************
> This e-mail is confidential, the property of NDS Ltd and intended  
> for the addressee only. Any dissemination, copying or distribution  
> of this message or any attachments by anyone other than the intended  
> recipient is strictly prohibited. If you have received this message  
> in error, please immediately notify the postmaster@nds.com and  
> destroy the original message. Messages sent to and from NDS may be  
> monitored. NDS cannot guarantee any message delivery method is  
> secure or error-free. Information could be intercepted, corrupted,  
> lost, destroyed, arrive late or incomplete, or contain viruses. We  
> do not accept responsibility for any errors or omissions in this  
> message and/or attachment that arise as a result of transmission.  
> You should carry out your own virus checks before opening any  
> attachment. Any views or opinions presented are solely those of the  
> author and do not necessarily represent those of NDS.
>
> To protect the environment please do not print this e-mail unless  
> necessary.
>
> NDS Limited Registered Office: One London Road, Staines, Middlesex,  
> TW18 4EX, United Kingdom. A company registered in England and Wales  
> Registered no. 3080780 VAT no. GB 603 8808 40-00
> **************************************************************************************
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------

Simplex sigillum veri. (Simplicity is the seal of truth.)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Mime
View raw message