Class ModuleInfoUtils

java.lang.Object
org.netbeans.modules.maven.api.ModuleInfoUtils

public final class ModuleInfoUtils extends Object
  • Constructor Details

    • ModuleInfoUtils

      public ModuleInfoUtils()
  • Method Details

    • addRequires

      public static void addRequires(NbMavenProject project, Collection<? extends org.apache.maven.artifact.Artifact> artifacts)
      Adds the given artifacts as require entries into module-info.java. The artifact scope determines the target module-info.java file - main or test. If there is no module-info.java file then nothing happens.
      Parameters:
      project -
      artifacts -
    • checkModuleInfoAndCompilerFit

      public static boolean checkModuleInfoAndCompilerFit(org.netbeans.api.project.Project prj)
      Determines if the configured maven-compiler-plugin isn't too old in case there is a main module-info.java in the given project (has to be >= 3.6).
      Parameters:
      prj - the project to be checked
      Returns:
      true if there is no module-info file or if the m-c-p version is new enough (>= 3.6). Otherwise false
    • hasModuleInfo

      public static boolean hasModuleInfo(NbMavenProject nbprj)