khmarbaise / maven-it-extension

Experimental JUnit Jupiter Extension for writing integration tests for Maven plugins/Maven extensions/Maven Core
https://khmarbaise.github.io/maven-it-extension/
Apache License 2.0
88 stars 28 forks source link

Improve doc on how to pass parameter to MavenOption when using MavenCLIOptions #474

Open Bukama opened 2 weeks ago

Bukama commented 2 weeks ago

Is your feature request related to a problem? Please describe. The way interfaces work it's a bit unclear how you pass a parameter to a @MavenOption, when using @MavenCLIOptions. Current (0.13.1) documentation only shows examples without arguments.

Describe the solution you'd like Improve documentation by adding an example with parameter as I think there are two solutions in general, but only the last is the best when using @MavenCLIOptions I think.

@MavenOption("-f pom.xml")

should result in the same as

@MavenOption(value = MavenCLIOptions.FILE, parameter = "pom.xml")

So full test could look like

@MavenTest
@MavenGoal("clean")
@MavenGoal("verify")
@MavenGoal("site")
@MavenOption(value = MavenCLIOptions.FILE, parameter = "pom.xml")
void mpmd_314_multiproject_with_pom_in_root_should_work(MavenExecutionResult result) {
    assertThat(result).isSuccessful();
}

Describe alternatives you've considered Leaving it as it be and blame the user to be stupid not knowing how to pass multiple parameters to a annotation. 🤷‍♂️

Additional context Documentation as of now only shows examples where the @MavenCLIOptions does not need a parameter and therefor it's not needed to write the value parameter of the @MavenOption annotation explicit.

image