本文整理汇总了Java中org.apache.maven.project.MavenProject.getCompileSourceRoots方法的典型用法代码示例。如果您正苦于以下问题:Java MavenProject.getCompileSourceRoots方法的具体用法?Java MavenProject.getCompileSourceRoots怎么用?Java MavenProject.getCompileSourceRoots使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.project.MavenProject
的用法示例。
在下文中一共展示了MavenProject.getCompileSourceRoots方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getJavaFiles
import org.apache.maven.project.MavenProject; //导入方法依赖的package包/类
/**
* Loads all java files from a Maven project and writes each of them to a
* list of {@link JavaFile} objects
*
* @param project
* Maven Project
* @return List of java files
* @throws JavaFileLoadException
* An error occured while loading the Java files
*/
public List<JavaFile> getJavaFiles(MavenProject project) throws JavaFileLoadException {
try {
List<Path> javaSourceFiles = new ArrayList<>();
List<?> rootDirectories = project.getCompileSourceRoots();
for (Object raw : rootDirectories) {
String rootDirectory = String.class.cast(raw);
javaSourceFiles.addAll(getJavaFileNames(Paths.get(rootDirectory)));
}
return getInformationFromJavaFiles(javaSourceFiles);
} catch (IOException ex) {
throw new JavaFileLoadException("Error while loading the java files!", ex);
}
}
示例2: getRoots
import org.apache.maven.project.MavenProject; //导入方法依赖的package包/类
private static Collection<String> getRoots(MavenProject mp, DependencyType type) {
final Collection<String> roots = type == DependencyType.TEST ? mp.getTestCompileSourceRoots() : mp.getCompileSourceRoots();
return roots;
}
示例3: getModuleInfo
import org.apache.maven.project.MavenProject; //导入方法依赖的package包/类
private FileObject getModuleInfo() {
MavenProject mp = project.getOriginalMavenProject();
Collection<String> roots = type == DependencyType.TEST ? mp.getTestCompileSourceRoots() : mp.getCompileSourceRoots();
return getModuleInfo(roots);
}