There are 2 possibilities, Jochen.
1. Introduce a parameter, as Karl-Heinz illustrated above. You may safely
set this parameter to "read-only" if your plugin merely wants to read/use -
but not expose or permit for a user to change - the source encoding value
for the plugin only. In that case, simply remove the "property" attribute
to get something like
@Parameter(defaultValue = "${project.build.sourceEncoding}")
private String encoding;
2. Inject a MavenProject and use it to acquire any build property you like:
@Parameter(defaultValue = "${project}", readonly = true)
private MavenProject project;
2015-09-27 10:53 GMT+02:00 Jochen Wiedmann <[email protected]>:
> On Sat, Sep 26, 2015 at 10:33 PM, Karl Heinz Marbaise <[email protected]>
> wrote:
> > Hi Jochen,
> >
> > On 9/26/15 10:28 PM, Jochen Wiedmann wrote:
> >>
> >> Hi,
> >>
> >> I'd like to access $[project.build.sourceEncoding} in a Maven Plugin.
> >> How would I do that? Using what version of maven-model?
> >
> >
> > Hm...you would like use that for a maven plugin ? Then it's used like
> this:
>
> No possibility without introduction of a new parameter?
>
> Thanks,
>
> Jochen
>
>
> --
> The next time you hear: "Don't reinvent the wheel!"
>
>
> http://www.keystonedevelopment.co.uk/wp-content/uploads/2014/10/evolution-of-the-wheel-300x85.jpg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
--
+==============================+
| Bästa hälsningar,
| [sw. "Best regards"]
|
| Lennart Jörelid
| EAI Architect & Integrator
|
| jGuru Europe AB
| Mölnlycke - Kista
|
| Email: [email protected]
| URL: www.jguru.se
| Phone
| (skype): jgurueurope
| (intl): +46 708 507 603
| (domestic): 0708 - 507 603
+==============================+