JavaHT GetLibrariesForModule

How do I get a list of libraries/dependencies of a project?

1) Get COMPILE classpaths of all Java non test source root.

Stream<ClassPath> cps = Arrays.stream(ProjectUtil.getSources(prj)
  .getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA))
  .map((sg)->sg.getRootFolder())
  .filter(nonTestRoot)
  .map((fo)->ClassPath.getClassPath(fo, ClassPath.COMPILE));

2) These classpaths in cps contain all the libraries.

-- provided by Tomas Zezula

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo