本文整理匯總了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);
}