use of com.thoughtworks.qdox.model.JavaModuleDescriptor in project maven-plugins by apache.
the class QDoxModuleInfoParser method getModuleDescriptor.
@Override
public org.apache.maven.plugin.compiler.module.JavaModuleDescriptor getModuleDescriptor(File modulePath) throws IOException {
File moduleDescriptor = new File(modulePath, "module-info.java");
org.apache.maven.plugin.compiler.module.JavaModuleDescriptor.Builder builder;
if (moduleDescriptor.exists()) {
JavaModuleDescriptor descriptor = new JavaProjectBuilder().addSourceFolder(modulePath).getDescriptor();
builder = org.apache.maven.plugin.compiler.module.JavaModuleDescriptor.newModule(descriptor.getName());
for (JavaModuleDescriptor.JavaRequires requires : descriptor.getRequires()) {
builder.requires(requires.getModule().getName());
}
for (JavaModuleDescriptor.JavaExports exports : descriptor.getExports()) {
builder.exports(exports.getSource().getName());
}
} else {
builder = org.apache.maven.plugin.compiler.module.JavaModuleDescriptor.newAutomaticModule(null);
}
return builder.build();
}
Aggregations