How to expose plugin variable to project?

I am intializing a variable in customised plugin Then I want to access in project level?

What purpose does that variable serve? It is a part of task or project configuration? If project, as you say, one way would be to create/set an extension property for that project, i.e. something like project.getExtensions().getExtraProperties().set(name, value). In that case I recommend exposing just one per plugin and have that one provide access to any number of actual variables and structured content. There are other ways.

See (and follow):

1 Like