奇怪的 javadoc 警告:找不到方法
Strange javadoc warning: can not find method
在 Maven 项目中有这个 class:
package test;
public class A {
/**
* Used by {@link B#setC(C)}.
* Used by {@link A.B#setC(C)}.
* Used by {@link test.A.B#setC(C)}.
*/
public class C {
}
public class B {
public void setC(C c) {
System.out.println("hello!");
}
}
}
给我这个警告:
C:\Users\user\workspace\t>mvn clean javadoc:javadoc
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building t 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ t ---
[INFO] Deleting C:\Users\user\workspace\t\target
[INFO]
[INFO] >>> maven-javadoc-plugin:2.10.4:javadoc (default-cli) > generate-sources @ t >>>
[INFO]
[INFO] <<< maven-javadoc-plugin:2.10.4:javadoc (default-cli) < generate-sources @ t <<<
[INFO]
[INFO] --- maven-javadoc-plugin:2.10.4:javadoc (default-cli) @ t ---
[WARNING] Source files encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO]
Loading source files for package test...
Constructing Javadoc information...
Standard Doclet version 1.8.0_101
Building tree for all the packages and classes...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\A.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\A.B.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\A.C.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\package-frame.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\package-summary.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\package-tree.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\constant-values.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\class-use\A.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\class-use\A.C.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\class-use\A.B.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\package-use.html...
Building index for all the packages and classes...
Generating C:\Users\user\workspace\t\target\site\apidocs\overview-tree.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\index-all.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\deprecated-list.html...
Building index for all classes...
Generating C:\Users\user\workspace\t\target\site\apidocs\allclasses-frame.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\allclasses-noframe.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\index.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\help-doc.html...
3 warnings
[WARNING] Javadoc Warnings
[WARNING] C:\Users\user\workspace\t\src\main\java\test\A.java:9: warning - Tag @link: can't find setC(C) in test.A.B
[WARNING] C:\Users\user\workspace\t\src\main\java\test\A.java:9: warning - Tag @link: can't find setC(C) in test.A.B
[WARNING] C:\Users\user\workspace\t\src\main\java\test\A.java:9: warning - Tag @link: can't find setC(C) in test.A.B
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.521 s
[INFO] Finished at: 2016-12-02T10:10:28+01:00
[INFO] Final Memory: 17M/309M
[INFO] ------------------------------------------------------------------------
C:\Users\user\workspace\t>
为什么javadoc说他找不到方法?
尝试Used by {@link A.B#setC(A.C)}
。
在 Maven 项目中有这个 class:
package test;
public class A {
/**
* Used by {@link B#setC(C)}.
* Used by {@link A.B#setC(C)}.
* Used by {@link test.A.B#setC(C)}.
*/
public class C {
}
public class B {
public void setC(C c) {
System.out.println("hello!");
}
}
}
给我这个警告:
C:\Users\user\workspace\t>mvn clean javadoc:javadoc
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building t 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ t ---
[INFO] Deleting C:\Users\user\workspace\t\target
[INFO]
[INFO] >>> maven-javadoc-plugin:2.10.4:javadoc (default-cli) > generate-sources @ t >>>
[INFO]
[INFO] <<< maven-javadoc-plugin:2.10.4:javadoc (default-cli) < generate-sources @ t <<<
[INFO]
[INFO] --- maven-javadoc-plugin:2.10.4:javadoc (default-cli) @ t ---
[WARNING] Source files encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO]
Loading source files for package test...
Constructing Javadoc information...
Standard Doclet version 1.8.0_101
Building tree for all the packages and classes...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\A.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\A.B.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\A.C.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\package-frame.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\package-summary.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\package-tree.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\constant-values.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\class-use\A.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\class-use\A.C.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\class-use\A.B.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\test\package-use.html...
Building index for all the packages and classes...
Generating C:\Users\user\workspace\t\target\site\apidocs\overview-tree.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\index-all.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\deprecated-list.html...
Building index for all classes...
Generating C:\Users\user\workspace\t\target\site\apidocs\allclasses-frame.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\allclasses-noframe.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\index.html...
Generating C:\Users\user\workspace\t\target\site\apidocs\help-doc.html...
3 warnings
[WARNING] Javadoc Warnings
[WARNING] C:\Users\user\workspace\t\src\main\java\test\A.java:9: warning - Tag @link: can't find setC(C) in test.A.B
[WARNING] C:\Users\user\workspace\t\src\main\java\test\A.java:9: warning - Tag @link: can't find setC(C) in test.A.B
[WARNING] C:\Users\user\workspace\t\src\main\java\test\A.java:9: warning - Tag @link: can't find setC(C) in test.A.B
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.521 s
[INFO] Finished at: 2016-12-02T10:10:28+01:00
[INFO] Final Memory: 17M/309M
[INFO] ------------------------------------------------------------------------
C:\Users\user\workspace\t>
为什么javadoc说他找不到方法?
尝试Used by {@link A.B#setC(A.C)}
。