Getting started with the Maven plugin

I am writing a very simple Maven plugin and I have lost some of the testing. Based on the plugin developers site , there are several different tools for accomplishing the same things whose documentation is out of date ... I found resources like this , and looked at the "main" plugins, but this is still very unclear to me.

Since there is no one solution for this, I ask for your personal experience here.

+3
source share
2 answers

I have nothing to add to the Overview of Plugin Testing Strategies page , which is pretty comprehensive and really depends on the kind of tests you want to write.

But since you are asking for practical feedback, my recommendation would be to write both unit tests and integration tests, and then it is very important when plugins (if you want to skip something, do not skip integration tests).

For unit tests, use maven-plugin-testing-harness . check out the Maven Plugin Harness Wiki and existing plugins such as the maven-compiler plugin (see CompilerMojoTestCase).

maven-invoker-plugin / shitty-maven-plugin. , , . . .

.

+3

Perl - .

. , JUnit; , , , Maven , .

0

Source: https://habr.com/ru/post/1755206/


All Articles