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:[email protected]]
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:[email protected]] 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: [email protected] For
additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For
additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For
additional commands, e-mail: [email protected]
--
Brett Porter
[email protected]
http://blogs.exist.com/bporter/
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For
additional commands, e-mail: [email protected]
**************************************************************************************
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 [email protected]
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: [email protected]
For additional commands, e-mail: [email protected]
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: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
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: [email protected]
For additional commands, e-mail: [email protected]