Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some problems with tag lib generation #1

Merged
merged 2 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,23 @@ public void execute() throws MojoExecutionException {
javadoc.setTaskName("jellydoc");
javadoc.setProject(p);

boolean foundDir = false;
for (Object dir : project.getCompileSourceRoots()) {
FileSet fs = new FileSet();
fs.setProject(p);
fs.setDir(new File(dir.toString()));
javadoc.addFileset(fs);
File dirFile = new File(dir.toString());
// For pom projects the dir might not exist
if (dirFile.exists()) {
FileSet fs = new FileSet();
fs.setProject(p);
fs.setDir(dirFile);
javadoc.addFileset(fs);
foundDir = true;
}
}

if (!foundDir) {
return;
}

javadoc.setClasspath(makePath(p,project.getArtifacts()));

Javadoc.DocletInfo d = javadoc.createDoclet();
Expand Down Expand Up @@ -245,8 +256,11 @@ public void generate(Sink sink, Locale locale) throws MavenReportException {
public void generate(Sink sink, SinkFactory sinkFactory, Locale locale) throws MavenReportException {
try {
execute();
new ReferenceRenderer(sink,new File(targetDir(),"taglib.xml").toURI().toURL()).render();
FileUtils.copyDirectory(targetDir(),new File(targetDir(),"site"),"taglib-*.xsd",null);
File libFile = new File(targetDir(), "taglib.xml");
if (libFile.exists()) {
new ReferenceRenderer(sink, libFile.toURI().toURL()).render();
FileUtils.copyDirectory(targetDir(), new File(targetDir(), "site"), "taglib-*.xsd", null);
}
} catch (AbstractMojoExecutionException | DocumentException | IOException e) {
throw new MavenReportException("Failed to generate report",e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private void packageXML(PackageDoc packageDoc, Tags tw) throws SAXException {

// generate tags
for (ClassDoc c : classArray) {
if (isTag(c)) {
if (isTag(c) && !c.isAbstract()) {
tagXML(c,library.tag());
}
}
Expand Down Expand Up @@ -174,10 +174,6 @@ private boolean isTag(ClassDoc classDoc) {
* Generates doc for a tag
*/
private void tagXML(ClassDoc classDoc, org.jvnet.maven.jellydoc.Tag tag) throws SAXException {
if (classDoc.isAbstract()) {
return;
}

tag.className(classDoc.name());
String name = classDoc.name();
if ( name.endsWith( "Tag" ) ) {
Expand Down