GMaven (OLD... DO NOT USE)

Allow manipulating properties (access to the real project object) in 'execute'

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.0-rc-3
  • Component/s: execute
  • Labels:
    None
  • Number of attachments :
    0

Description

Maven is lacking scripting to set up properties. It would be good if the groovy 'execute' goal could manipulate project properties (meaning, set them back in the project object).

Right now, the 'project' object in the execution context of the groovy code is a clone of the actual project.

To overcome this, simplest is to just add 'mavenProject' to the context which references the real project.

Activity

Hide
Ittay Dror added a comment -

Thanks for fixing this.

Also, It would be good to have 'session'.

Show
Ittay Dror added a comment - Thanks for fixing this. Also, It would be good to have 'session'.
Hide
Jason Dillon added a comment -

Session has been added, so you can do something like this:

session.currentProject.properties['myproperty'] = 'something'

Which will set the property in the project as expected. There is also a session hidden in the project adapter, so you could also have done:

project.session.currentProject.properties['myproperty'] = 'something'
Show
Jason Dillon added a comment - Session has been added, so you can do something like this:
session.currentProject.properties['myproperty'] = 'something'
Which will set the property in the project as expected. There is also a session hidden in the project adapter, so you could also have done:
project.session.currentProject.properties['myproperty'] = 'something'
Hide
Jason Dillon added a comment -

But I think that it would be nicer to just have the adapter set properties via the normal route, will try to get that working.

Show
Jason Dillon added a comment - But I think that it would be nicer to just have the adapter set properties via the normal route, will try to get that working.
Hide
Jason Dillon added a comment -

Added support for:

  • {{project.properties['xxx'] = 'yyy'}}
  • project.properties.set('xxx', 'yyy')
  • project.properties.setProperty('xxx', 'yyy')

This allows the pom's properties to be changed and used in any execution.

Show
Jason Dillon added a comment - Added support for:
  • {{project.properties['xxx'] = 'yyy'}}
  • project.properties.set('xxx', 'yyy')
  • project.properties.setProperty('xxx', 'yyy')
This allows the pom's properties to be changed and used in any execution.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: