Skip to content

Commit e9729ce

Browse files
committed
[MJAVADOC-453] Using Alternate Doclet documentation example snippet is out of date and does not work
1 parent 9f98af7 commit e9729ce

File tree

6 files changed

+135
-29
lines changed

6 files changed

+135
-29
lines changed

pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,9 @@ under the License.
475475
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
476476
<projectsDirectory>src/it/projects</projectsDirectory>
477477
<settingsFile>src/it/mrm/settings.xml</settingsFile>
478+
<pomIncludes combine.children="append">
479+
<pomInclude>examples/*/pom.xml</pomInclude>
480+
</pomIncludes>
478481
<pomExcludes>
479482
<pomExclude>MJAVADOC-181/pom.xml</pomExclude> <!-- seems to be wrong, see comment in Jira issue -->
480483
<pomExclude>output-encoding/pom.xml</pomExclude>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# this plugins expects tools.jar, hence Java 8 or before
19+
invoker.java.version=9-
20+
invoker.goals=javadoc:javadoc
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
-->
20+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
22+
23+
<groupId>org.apache.maven.plugins.javadoc.example</groupId>
24+
<artifactId>alternate-doclet</artifactId>
25+
<version>1.0.0-SNAPSHOT</version>
26+
27+
<properties>
28+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
29+
<maven.compiler.source>@maven.compiler.source@</maven.compiler.source>
30+
<maven.compiler.target>@maven.compiler.target@</maven.compiler.target>
31+
</properties>
32+
33+
<url>http://maven.apache.org/plugins/maven-javadoc-plugin/examples/alternate-doclet.html</url>
34+
35+
<build>
36+
<plugins>
37+
<!-- START SNIPPET: umlgraph -->
38+
<plugin>
39+
<groupId>org.apache.maven.plugins</groupId>
40+
<artifactId>maven-javadoc-plugin</artifactId>
41+
<version>@project.version@</version>
42+
<configuration>
43+
<doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
44+
<docletArtifact>
45+
<!-- UMLGraph cannot be used with Java 9 or above due to substantial changes in the JavaDoc Doclet API-->
46+
<groupId>org.umlgraph</groupId>
47+
<artifactId>umlgraph</artifactId>
48+
<version>5.6.6</version>
49+
</docletArtifact>
50+
<additionalparam>-views</additionalparam>
51+
</configuration>
52+
</plugin>
53+
<!-- END SNIPPET: umlgraph -->
54+
</plugins>
55+
</build>
56+
</project>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.example;
2+
3+
/*
4+
* Licensed to the Apache Software Foundation (ASF) under one
5+
* or more contributor license agreements. See the NOTICE file
6+
* distributed with this work for additional information
7+
* regarding copyright ownership. The ASF licenses this file
8+
* to you under the Apache License, Version 2.0 (the
9+
* "License"); you may not use this file except in compliance
10+
* with the License. You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing,
15+
* software distributed under the License is distributed on an
16+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
* KIND, either express or implied. See the License for the
18+
* specific language governing permissions and limitations
19+
* under the License.
20+
*/
21+
22+
/**
23+
* This is a Foo.
24+
*/
25+
public interface Foo
26+
{
27+
/**
28+
* Frobnicates the foo.
29+
*/
30+
public void frobnicate();
31+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
File options = new File( basedir, 'target/site/apidocs/options' )
21+
22+
assert options.text.readLines().dropWhile{it != '-doclet'}.get(1) == "'org.umlgraph.doclet.UmlGraphDoc'"
23+
assert options.text.readLines().dropWhile{it != '-docletpath'}.get(1).contains('org/umlgraph/umlgraph/5.6.6/umlgraph-5.6.6.jar')
24+

src/site/apt/examples/alternate-doclet.apt.vm

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -37,35 +37,7 @@ Using Alternate Doclet
3737
<<Note about UmlGraph>>: You must have the Graphviz binary in your PATH, or the images will not be generated.
3838
For more information about Graphviz, please refer to {{http://www.graphviz.org/}}.
3939

40-
+-----+
41-
<project>
42-
...
43-
<reporting> (or <build>)
44-
<plugins>
45-
<plugin>
46-
<groupId>org.apache.maven.plugins</groupId>
47-
<artifactId>maven-javadoc-plugin</artifactId>
48-
<version>${project.version}</version>
49-
<configuration>
50-
<doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
51-
52-
<!-- <docletPath>/path/to/UmlGraph.jar</docletPath> -->
53-
<docletArtifact>
54-
<groupId>org.umlgraph</groupId>
55-
<artifactId>doclet</artifactId>
56-
<version>5.1</version>
57-
</docletArtifact>
58-
<additionalOptions>
59-
<additionalOption>-views</additionalOption>
60-
</additionalOptions>
61-
</configuration>
62-
</plugin>
63-
...
64-
</plugins>
65-
</reporting> (or </build>)
66-
...
67-
</project>
68-
+-----+
40+
%{snippet|id=umlgraph|file=target/it/examples/alternate-doclet/pom.xml}
6941

7042
<<Note>>:
7143

0 commit comments

Comments
 (0)