-
Notifications
You must be signed in to change notification settings - Fork 38
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
[WIP] [MPLUGINTESTING-93] - Prepare documentation / examples for JUnit 5 and Maven 3 #50
base: maven-plugin-testing-3.x
Are you sure you want to change the base?
[WIP] [MPLUGINTESTING-93] - Prepare documentation / examples for JUnit 5 and Maven 3 #50
Conversation
@@ -16,7 +16,7 @@ | |||
* specific language governing permissions and limitations | |||
* under the License. | |||
*/ | |||
package org.apache.maven.plugin.testing.junit5; | |||
package org.apache.maven.api.plugin.testing; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this may collide with Maven 4 apis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @slachiewicz ,
yes this might collide and this I am doing by intent.
Consider the following use case:
Somebody uses @InjectMojo
on maven version 3 and creates JUnit Jupiter test cases to test his/her Mojo.
Then he/she decides to migrate to Maven4.
As the codelines differ between maven3/maven4, there might be glitches / issues. But the migration will be a lot less cumbersome if you don't have to rename all the imports just because the package changes from maven3 to maven4. This is why I would like to have the same Packages on Maven3/4.
Does that make sense or should we strictly separate the packages and make the maven3-4 migration cumbersome for the consumers?
PS: I made some experiments and at least for my limited use cases the migration from maven3 to 4 with this setup went really smooth. Still thinking how to deal with One Exception which got relocated between 3 to 4 which I plan to provide some further solution.
This is really interesting. |
Hi @gnodet , So what's left open is the stubbing. I made a check and backporting all the stubs seems to be a bigger task. My current opinion is to NOT offer the stubs on maven 3 (which means maven-plugin-testing with stubs is only possible with old JUnit 4 style tests extending the AbstractMojoTestCase). What is your opinion there? |
starting some documentation activities now and performing testing of the JUnit5 maven-plugin testing capabilities with existing open source maven plugins.
@gnodet I have made a small change in the MojoExtension as I think it's valid to have no configuration for your maven plugin at all. I'll just take the commit away if my understanding here is wrong