Skip to content

Commit 396b92a

Browse files
Convert current documentation to markdown
1 parent ce983e8 commit 396b92a

File tree

9 files changed

+386
-332
lines changed

9 files changed

+386
-332
lines changed

maven-plugin-testing-harness/src/site/apt/index.apt

Lines changed: 0 additions & 46 deletions
This file was deleted.

maven-plugin-testing-harness/src/site/apt/examples/artifact.apt renamed to maven-plugin-testing-harness/src/site/markdown/examples/artifact.md

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,34 @@
1-
------
2-
Testing Project Artifact
3-
------
4-
Vincent Siveton
5-
------
6-
February 2008
7-
------
8-
9-
~~ Licensed to the Apache Software Foundation (ASF) under one
10-
~~ or more contributor license agreements. See the NOTICE file
11-
~~ distributed with this work for additional information
12-
~~ regarding copyright ownership. The ASF licenses this file
13-
~~ to you under the Apache License, Version 2.0 (the
14-
~~ "License"); you may not use this file except in compliance
15-
~~ with the License. You may obtain a copy of the License at
16-
~~
17-
~~ http://www.apache.org/licenses/LICENSE-2.0
18-
~~
19-
~~ Unless required by applicable law or agreed to in writing,
20-
~~ software distributed under the License is distributed on an
21-
~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22-
~~ KIND, either express or implied. See the License for the
23-
~~ specific language governing permissions and limitations
24-
~~ under the License.
25-
26-
Testing Project Artifact
27-
28-
<<Note>>: This example improves the {{{../getting-started/index.html}cookbook}} to play with artifact handler.
29-
30-
Sometimes, your Mojo uses project artifact and ArtifactHandler mechanisms. For instance, you could need to
31-
filter on Java projects, i.e.:
32-
33-
+---+
1+
title: Testing Project Artifact
2+
author: Vincent Siveton
3+
date: February 2008
4+
5+
<!-- Licensed to the Apache Software Foundation (ASF) under one -->
6+
<!-- or more contributor license agreements. See the NOTICE file -->
7+
<!-- distributed with this work for additional information -->
8+
<!-- regarding copyright ownership. The ASF licenses this file -->
9+
<!-- to you under the Apache License, Version 2.0 (the -->
10+
<!-- "License"); you may not use this file except in compliance -->
11+
<!-- with the License. You may obtain a copy of the License at -->
12+
<!-- -->
13+
<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
14+
<!-- -->
15+
<!-- 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 Project Artifact
22+
23+
24+
**Note**: This example improves the [cookbook](../getting-started/index.html) to play with artifact handler.
25+
26+
27+
Sometimes, your Mojo uses project artifact and ArtifactHandler mechanisms. For instance, you could need to filter on Java projects, i.e.:
28+
29+
30+
31+
```
3432
public class MyMojo
3533
extends AbstractMojo
3634
{
@@ -54,11 +52,13 @@ public class MyMojo
5452
...
5553
}
5654
}
57-
+---+
55+
```
56+
57+
### Create Stubs
5858

59-
* Create Stubs
6059

61-
+---+
60+
61+
```
6262
public class MyArtifactHandlerStub
6363
extends DefaultArtifactHandler
6464
{
@@ -79,9 +79,10 @@ public class MyArtifactHandlerStub
7979
this.language = language;
8080
}
8181
}
82-
+---+
82+
```
83+
8384

84-
+---+
85+
```
8586
public class MyArtifactStub
8687
extends ArtifactStub
8788
{
@@ -189,9 +190,10 @@ public class MyArtifactStub
189190
this.handler = handler;
190191
}
191192
}
192-
+---+
193+
```
193194

194-
+---+
195+
196+
```
195197
public class MyProjectStub
196198
extends MavenProjectStub
197199
{
@@ -212,4 +214,6 @@ public class MyProjectStub
212214
213215
...
214216
}
215-
+---+
217+
```
218+
219+

maven-plugin-testing-harness/src/site/apt/examples/complex-mojo-parameters.apt renamed to maven-plugin-testing-harness/src/site/markdown/examples/complex-mojo-parameters.md

Lines changed: 55 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,37 @@
1-
------
2-
Testing Complex Mojo Parameters
3-
------
4-
Vincent Siveton
5-
------
6-
February 2008
7-
------
8-
9-
~~ Licensed to the Apache Software Foundation (ASF) under one
10-
~~ or more contributor license agreements. See the NOTICE file
11-
~~ distributed with this work for additional information
12-
~~ regarding copyright ownership. The ASF licenses this file
13-
~~ to you under the Apache License, Version 2.0 (the
14-
~~ "License"); you may not use this file except in compliance
15-
~~ with the License. You may obtain a copy of the License at
16-
~~
17-
~~ http://www.apache.org/licenses/LICENSE-2.0
18-
~~
19-
~~ Unless required by applicable law or agreed to in writing,
20-
~~ software distributed under the License is distributed on an
21-
~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22-
~~ KIND, either express or implied. See the License for the
23-
~~ specific language governing permissions and limitations
24-
~~ under the License.
25-
26-
Testing Complex Mojo Parameters
27-
28-
<<Note>>: This example improves the {{{../getting-started/index.html}cookbook}} for testing complex Mojo parameters.
29-
30-
In real plugin development, you will use specific Maven objects like <<<MavenProject>>>, <<<ArtifactRepository>>> or
31-
<<<MavenSettings>>>. You could use them by defining stubs.
1+
title: Testing Complex Mojo Parameters
2+
author: Vincent Siveton
3+
date: February 2008
4+
5+
<!-- Licensed to the Apache Software Foundation (ASF) under one -->
6+
<!-- or more contributor license agreements. See the NOTICE file -->
7+
<!-- distributed with this work for additional information -->
8+
<!-- regarding copyright ownership. The ASF licenses this file -->
9+
<!-- to you under the Apache License, Version 2.0 (the -->
10+
<!-- "License"); you may not use this file except in compliance -->
11+
<!-- with the License. You may obtain a copy of the License at -->
12+
<!-- -->
13+
<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
14+
<!-- -->
15+
<!-- 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+
3229

3330
Suppose that you have the following dependencies in the maven-my-plugin pom:
3431

35-
+---+
32+
33+
34+
```
3635
<project>
3736
...
3837
<dependencies>
@@ -49,11 +48,13 @@ Testing Complex Mojo Parameters
4948
...
5049
</dependencies>
5150
</project>
52-
+---+
51+
```
52+
53+
You will add the following in the `MyMojo`:
54+
5355

54-
You will add the following in the <<<MyMojo>>>:
5556

56-
+---+
57+
```
5758
public class MyMojo
5859
extends AbstractMojo
5960
{
@@ -77,14 +78,16 @@ public class MyMojo
7778
7879
...
7980
}
80-
+---+
81+
```
8182

82-
* Create Stubs
83+
### Create Stubs
8384

84-
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>>>.
8685

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+
```
8891
public class MyProjectStub
8992
extends MavenProjectStub
9093
{
@@ -136,9 +139,10 @@ public class MyProjectStub
136139
return new File( super.getBasedir() + "/src/test/resources/unit/project-to-test/" );
137140
}
138141
}
139-
+---+
142+
```
140143

141-
+---+
144+
145+
```
142146
public class SettingsStub
143147
extends Settings
144148
{
@@ -148,11 +152,14 @@ public class SettingsStub
148152
return Collections.EMPTY_LIST;
149153
}
150154
}
151-
+---+
155+
```
156+
152157

153-
* Configure <<<project-to-test>>> pom
158+
### Configure `project-to-test` pom
154159

155-
+---+
160+
161+
162+
```
156163
<project>
157164
...
158165
<build>
@@ -174,4 +181,6 @@ public class SettingsStub
174181
</plugins>
175182
</build>
176183
</project>
177-
+---+
184+
```
185+
186+

0 commit comments

Comments
 (0)