You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Paul Gier <pg...@redhat.com> on 2009/03/25 16:54:16 UTC

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


Re: Recording build environment

Posted by Jason van Zyl <jv...@sonatype.com>.
On 27-Mar-09, at 9:07 AM, Paul Gier wrote:

> Jason van Zyl wrote:
>> 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.
>
> I don't consider the current version of maven "arbitrary"  
> information, since IMO it's an important part of ensuring that the  
> build is reproducible.
>

Sure, there could be a base like version and scm source. Above and  
beyond that it would be arbitrary. I've seen dozens of implementations  
of plugins that collect build time information to deploy it with the  
artifact in question. And then when we get into scm information then  
even that is interesting in storing the coordinate. So those things I  
wouldn't mind standardizing and making that information available.

> I think James' question was more related to Brett's comment about  
> the plugin not working in Maven 3.  So he's wondering what will need  
> to change in the plugin to keep it working in the future.
>

Easy enough to get it working in Maven 3.x. If someone gives us an  
integration test it gets fixed quickly.

>>> /**
>>> * 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
>
>
> ---------------------------------------------------------------------
> 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
----------------------------------------------------------

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.

   -- Jacques Ellul, The Technological Society


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


Re: Recording build environment

Posted by Paul Gier <pg...@redhat.com>.
Jason van Zyl wrote:
> 
> 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.
> 

I don't consider the current version of maven "arbitrary" information, since IMO 
it's an important part of ensuring that the build is reproducible.

I think James' question was more related to Brett's comment about the plugin not 
working in Maven 3.  So he's wondering what will need to change in the plugin to 
keep it working in the future.

>> /**
>> * 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
> 


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


Re: Recording build environment

Posted by Jason van Zyl <jv...@sonatype.com>.
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


Re: Recording build environment

Posted by Paul Gier <pg...@redhat.com>.
Thanks for the code!  Maybe this goal could be added to something like the 
buildnumber-maven-plugin?

Nord, James wrote:
> What would be the solution for Maven 3? I currently have a plug-in that
> does exactly what you describe.
> 
> /**
>  * 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
> 


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


RE: Recording build environment

Posted by "Nord, James" <JN...@nds.com>.
What would be the solution for Maven 3? I currently have a plug-in that
does exactly what you describe.

/**
 * 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


Re: Recording build environment

Posted by Jason van Zyl <jv...@sonatype.com>.
There's an example somewhere that John made which records whatever you  
want and attaches that information as part of the deploy.

On 27-Mar-09, at 7:04 AM, Paul Gier wrote:

> It seems reasonable to me to have a property that contains this  
> information, so I created MNG-4112.  The property could probably  
> also be used to resolve MSHARED-38.  Of course the negative part is  
> that the property wouldn't work with earlier versions of maven, but  
> maybe it can start with 3.0.
>
> Brett Porter wrote:
>> 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
>
>
> ---------------------------------------------------------------------
> 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
----------------------------------------------------------

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.

   -- Jacques Ellul, The Technological Society


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


Re: Recording build environment

Posted by Paul Gier <pg...@redhat.com>.
It seems reasonable to me to have a property that contains this information, so 
I created MNG-4112.  The property could probably also be used to resolve 
MSHARED-38.  Of course the negative part is that the property wouldn't work with 
earlier versions of maven, but maybe it can start with 3.0.

Brett Porter wrote:
> 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
> 


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


Re: Recording build environment

Posted by Brett Porter <br...@apache.org>.
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


RE: Recording build environment

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Not a property, but there's a component - RuntimeInformation iirc that
has it. Take a look at the enforcer:display-info goal code, it shows all
of it for you.

-----Original Message-----
From: Paul Gier [mailto:pgier@redhat.com] 
Sent: Wednesday, March 25, 2009 3:21 PM
To: Maven Developers List
Subject: Re: Recording build environment

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


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


Re: Recording build environment

Posted by Paul Gier <pg...@redhat.com>.
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


RE: Recording build environment

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
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