Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Dec 4, 2024

Conversation

mawasak
Copy link
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
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
5 checks passed
@mawasak
Copy link
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
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants