maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "MATHUS Baptiste" <mathu...@mipih.fr>
Subject Passing parameters to maven classes
Date Sun, 30 Mar 2008 14:00:22 GMT
Hi all,

I've got some small questions about plugin development. More particularly about passing parameters.
If you think this question should better be asked on the mvn-dev ML, please let me know.

I saw how to do it for a mojo: according to a declaration like this:
/**
     * @parameter expression="${project.packaging}"
     * @required
     * @readonly
     */
plexus, the IoC framework used by maven will then pass the requested -D params to the mojo.

But what about maven "core" projects (how do you call it, btw? Maven core? Non-mojo? maven
api?). For example, say I want that a -Dvar=value variable be passed to some maven code that's
not a mojo (wagon-provider-api, maven-artifact e.g.). Some switch that I would like to use
in this maven api code.

What's the practice to do it?
Should I manage the parameter in the mojo, and then add a parameter in the non-mojo code to
pass the retrieved value from the calling mojo to the api code?
Should I use some special "configurer" from plexus to inject system property directly into
the api code?

Thanks a lot in advance.

Cheers.
-- Baptiste

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message