Skip to content

Adding "property" attribute for scripts parameter in execute mojo#316

Merged
keeganwitt merged 4 commits intogroovy:masterfrom
mawasak:mw/master
Dec 4, 2024
Merged

Adding "property" attribute for scripts parameter in execute mojo#316
keeganwitt merged 4 commits intogroovy:masterfrom
mawasak:mw/master

Conversation

@mawasak
Copy link
Copy Markdown
Contributor

@mawasak mawasak commented Dec 1, 2024

Without "property" attribute in "Parameter" calling execute mojo from command line is not working.
For example for call:
mvn org.codehaus.gmavenplus:gmavenplus-plugin:4.0.2-SNAPSHOT:execute -Dscripts="src\main\groovy\FooScript.groovy"

I got:
The parameters 'scripts' for goal org.codehaus.gmavenplus:gmavenplus-plugin:4.0.2-SNAPSHOT:execute are missing or invalid

When "property" attribute is added, execute mojo is working, eg.:

mvn org.codehaus.gmavenplus:gmavenplus-plugin:4.0.2-SNAPSHOT:execute -Dgp.exec.scripts="src\main\groovy\FooScript.groovy"

@keeganwitt
Copy link
Copy Markdown
Member

Thanks for the PR! I changed the variable name since other properties didn't include a prefix. I'm not sure if that was the best choice to have made (I think that dates back to the original GMaven days), but thought it was better to be consistent. I also added a couple additional properties I thought might be useful.

@keeganwitt keeganwitt added this to the 4.0.2 milestone Dec 4, 2024
@keeganwitt keeganwitt merged commit 80ad2e7 into groovy:master Dec 4, 2024
@mawasak
Copy link
Copy Markdown
Contributor Author

mawasak commented Dec 4, 2024

Thanks.
Regarding properties names I added prefix in case of any possible conflict in other plugins. I think the same reason was in case of exec-maven-plugin for java, eg.:
https://github.com/mojohaus/exec-maven-plugin/blob/master/src/main/java/org/codehaus/mojo/exec/ExecJavaMojo.java#L76

But yes - shorter version is nice to use and consistent with parameter name.

@keeganwitt
Copy link
Copy Markdown
Member

I had the same thought about collisions, but wasn't seeing prefixes in official Maven plugins. It appears they don't make any specific recommendations about that.

What I meant by consistency was with the other parameter properties that already exist. I'd like them to be all prefixed, or none of them.

@keeganwitt keeganwitt modified the milestones: 4.0.2, 4.1.0 Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants