I'm trying to write a simple Java doclet program where it uses com.sun.javadoc package.
And I also imported the tools.jar as a dependency for the project. And I can run the application without a problem and the desired results can be obtained.
But when I'm trying to compile the project using maven it gives some errors and will fail the build as well.
[ERROR] /home/xxx/xxx/Check.java:[20,33] cannot find symbol
symbol: class RootDoc
location: class com.sic.checkers.Check
[ERROR] /home/xxx/xxx/Check.java:[26,39] cannot find symbol
symbol: class PackageDoc
location: class com.sic.checkers.Check
[ERROR] /home/xxx/xxx/ListTags.java:[3,1] package com.sun.javadoc does not exist
[ERROR] /home/xxx/xxx/ListTags.java:[6,33] cannot find symbol
symbol: class RootDoc
location: class com.sic.checkers.ListTags
[ERROR] /home/xxx/xxx/ListTags.java:[12,39] cannot find symbol
symbol: class ClassDoc
location: class com.sic.checkers.ListTags
I check other similar questions but they seems to have no solutions for this as well.
What can be the problem here !