Issue Details (XML | Word | Printable)

Key: MGROOVY-121
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jason Dillon
Reporter: Ittay Dror
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
GMaven (OLD... DO NOT USE)

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

Created: 02/Apr/08 02:02 AM   Updated: 10/Aug/08 12:44 PM
Component/s: execute
Affects Version/s: None
Fix Version/s: 1.0-rc-3

Time Tracking:
Not Specified


 Description  « Hide
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.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Ittay Dror added a comment - 08/Apr/08 05:52 AM
Thanks for fixing this.

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


Jason Dillon added a comment - 15/May/08 04:46 PM
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'

Jason Dillon added a comment - 15/May/08 04:47 PM
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.

Jason Dillon added a comment - 10/Aug/08 12:44 PM
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.