You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- Unless required by applicable law or agreed to in writing, -->
16
+
<!-- software distributed under the License is distributed on an -->
17
+
<!-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -->
18
+
<!-- KIND, either express or implied. See the License for the -->
19
+
<!-- specific language governing permissions and limitations -->
20
+
<!-- under the License. -->
21
+
## Testing Complex Mojo Parameters
22
+
23
+
24
+
**Note**: This example improves the [cookbook](../getting-started/index.html) for testing complex Mojo parameters.
25
+
26
+
27
+
In real plugin development, you will use specific Maven objects like `MavenProject`, `ArtifactRepository` or `MavenSettings`. You could use them by defining stubs.
28
+
32
29
33
30
Suppose that you have the following dependencies in the maven-my-plugin pom:
You need to create stub objects to run <<<MyMojoTest#testSomething()>>>. By convention, the package name should
85
-
reflect the stubs, i.e. in our case <<<org.apache.maven.plugin.my.stubs>>>.
86
85
87
-
+---+
86
+
You need to create stub objects to run `MyMojoTest#testSomething()`. By convention, the package name should reflect the stubs, i.e. in our case `org.apache.maven.plugin.my.stubs`.
87
+
88
+
89
+
90
+
```
88
91
public class MyProjectStub
89
92
extends MavenProjectStub
90
93
{
@@ -136,9 +139,10 @@ public class MyProjectStub
136
139
return new File( super.getBasedir() + "/src/test/resources/unit/project-to-test/" );
0 commit comments