Grails Maven Plugin

Automatically sync. application.properties Grails version with the versions declared in the POM

Details

  • Type: Sub-task Sub-task
  • Status: Reopened Reopened
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Issue Links

Activity

Hide
Michael Lawler added a comment -

This is now available by including the "set-version" goal in your execution's goal list.

Show
Michael Lawler added a comment - This is now available by including the "set-version" goal in your execution's goal list.
Hide
Peter Ledbrook added a comment -

Shouldn't it be included in the grails-app and grails-plugin lifecycles?

Show
Peter Ledbrook added a comment - Shouldn't it be included in the grails-app and grails-plugin lifecycles?
Hide
Michael Lawler added a comment -

Good idea. I'll do it.

Show
Michael Lawler added a comment - Good idea. I'll do it.
Hide
Graeme Rocher added a comment -
Show
Graeme Rocher added a comment - fixed by http://github.com/grails/grails-maven/commit/9be9f07e9027650580f9248abb673d7f98f05587 Thanks for the contribution
Hide
Michael Lawler added a comment -

Hmm. I added a new optional mojo "SetVersion" which you could use if you wanted to. However, what we are discussing now is to make the plugin by default overwrite the grails version with the maven version. I am fine with this, but in implementing it we have some decisions.

Currently at 'validate' phase, the plugin invokes MvnValidatePluginMojo which checks to see whether the grails version and maven version match. It borks if they dont. To get around this, I was executing my optional SetVersion before this.

But now that I look at having setVersion be executed every time, it doesnt make sense to me to have v'alidate' check and enforce versions at validate time. It could either ignore versions, or programatically update the grails project at this time itself, or it could invoke 'setversion' to do the job at this time too.

I'm all ears but I propose:

1. MvnValidateMojo doesnt bother checking versions any more.
2. SetVersion is added to default lifeycle to executed at 'process-sources' time to set grails version based on maven version

Show
Michael Lawler added a comment - Hmm. I added a new optional mojo "SetVersion" which you could use if you wanted to. However, what we are discussing now is to make the plugin by default overwrite the grails version with the maven version. I am fine with this, but in implementing it we have some decisions. Currently at 'validate' phase, the plugin invokes MvnValidatePluginMojo which checks to see whether the grails version and maven version match. It borks if they dont. To get around this, I was executing my optional SetVersion before this. But now that I look at having setVersion be executed every time, it doesnt make sense to me to have v'alidate' check and enforce versions at validate time. It could either ignore versions, or programatically update the grails project at this time itself, or it could invoke 'setversion' to do the job at this time too. I'm all ears but I propose: 1. MvnValidateMojo doesnt bother checking versions any more. 2. SetVersion is added to default lifeycle to executed at 'process-sources' time to set grails version based on maven version
Hide
Peter Ledbrook added a comment -

I don't see the point in checking whether the versions match and think that automatically syncing the two versions is the best approach. If adding SetVersion to the process-sources phase is OK with you, then go for it. Will it work for clean too?

Show
Peter Ledbrook added a comment - I don't see the point in checking whether the versions match and think that automatically syncing the two versions is the best approach. If adding SetVersion to the process-sources phase is OK with you, then go for it. Will it work for clean too?
Hide
Peter Ledbrook added a comment -

Opening until the automatic syncing of versions is done.

Show
Peter Ledbrook added a comment - Opening until the automatic syncing of versions is done.
Hide
Reiner Saddey added a comment -

Great news! [GRAILS-5859 maven release:prepare fails because of version not changed in application.properties|GRAILS-5859] might be a duplicate.

Show
Reiner Saddey added a comment - Great news! [GRAILS-5859 maven release:prepare fails because of version not changed in application.properties|GRAILS-5859] might be a duplicate.
Hide
Lee Butts added a comment -

Also, set-version doesn't play nicely with the <nonInteractive> config param e.g.

app.version=--non-interactive\n1.16.0-SNAPSHOT
Show
Lee Butts added a comment - Also, set-version doesn't play nicely with the <nonInteractive> config param e.g.
app.version=--non-interactive\n1.16.0-SNAPSHOT

People

Vote (13)
Watch (11)

Dates

  • Created:
    Updated: