org.guvnor.common.services.project.model.Module类的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(155)

本文整理了Java中org.guvnor.common.services.project.model.Module类的一些代码示例,展示了Module类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Module类的具体详情如下:
包路径:org.guvnor.common.services.project.model.Module
类名称:Module

Module介绍

[英]An item representing a module. Each module has a pom.xml file and a folder it belongs into, it can have a parent and child modules. Note that the child and parent might not be in the same repository.
[中]表示模块的项。每个模块都有一个pom。xml文件和它所属的文件夹,可以有父模块和子模块。请注意,子级和父级可能不在同一个存储库中。

代码示例

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-datasource-mgmt-client

private boolean contains(Collection<Module> modules,
             Module activeModule) {
  if (modules != null) {
    for (Module module : modules) {
      if (module.getRootPath().equals(activeModule.getRootPath())) {
        return true;
      }
    }
  }
  return false;
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-examples-screen-backend

protected String readDescription(final Module module) {
  final Path root = module.getRootPath();
  final POM pom = module.getPom();
  final org.uberfire.java.nio.file.Path nioRoot = Paths.convert(root);
  final org.uberfire.java.nio.file.Path nioDescription = nioRoot.resolve(PROJECT_DESCRIPTON);
  String description = "Example '" + module.getModuleName() + "' module";
  if (ioService.exists(nioDescription)) {
    description = ioService.readAllString(nioDescription);
  } else if (pom != null
      && pom.getDescription() != null
      && !pom.getDescription().isEmpty()) {
    description = pom.getDescription();
  }
  if (description != null) {
    return description.replaceAll("\\s+",
                   " ");
  }
  return description;
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-explorer-backend

private void indexModule(final Module module,
             final String key) {
  final String moduleRef = module.getPomXMLPath().toURI();
  if (!moduleKeys.containsKey(moduleRef)) {
    moduleKeys.put(moduleRef,
            new HashSet<String>());
  }
  moduleKeys.get(moduleRef).add(key);
}

代码示例来源:origin: org.uberfire/uberfire-project-backend

private void addModule(final Module module) {
    module.setPom(pomService.load(module.getPomXMLPath()));
    modules.add(module);
  }
}

代码示例来源:origin: org.uberfire/uberfire-project-backend

private Module mockModule(final String myOldProject,
               final Path myOldProjectRootPath) {
    final Module module = mock(Module.class);
    when(module.getModuleName()).thenReturn(myOldProject);
    when(module.getRootPath()).thenReturn(myOldProjectRootPath);
    return module;
  }
}

代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend

message.append("Build of module '" + module.getModuleName() + "' (requested by " + getIdentifier() + ") completed.\n");
message.append(" Build: " + (results.getErrorMessages().isEmpty() ? "SUCCESSFUL" : "FAILURE"));
final POM pom = pomService.load(module.getPomXMLPath());
if (results.getErrorMessages().isEmpty()) {
  final Builder builder = cache.assertBuilder(module);
  if (!suppressHandlers) {
    results.addParameter("RootPath", module.getRootPath().toURI());
    for (PostBuildHandler handler : handlers) {
      try {
return buildExceptionResults(e, module.getPom().getGav());

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-client

protected WorkspaceProject createProject() {
  final Path rootPath = mock(Path.class);
  doReturn("git://modulePath").when(rootPath).toURI();
  final Module module = mock(Module.class);
  doReturn("mainModuleName").when(module).getModuleName();
  doReturn("modulePath").when(module).getIdentifier();
  doReturn(rootPath).when(module).getRootPath();
  final Path pomPath = mock(Path.class);
  doReturn(pomPath).when(module).getPomXMLPath();
  final OrganizationalUnit organizationalUnit = mock(OrganizationalUnit.class);
  final Repository repository = mock(Repository.class);
  final Path repositoryRootPath = mock(Path.class);
  doReturn(Optional.of(new Branch("master",
                  repositoryRootPath))).when(repository).getDefaultBranch();
  doReturn("rootpath").when(repositoryRootPath).toURI();
  return new WorkspaceProject(organizationalUnit,
                repository,
                new Branch("master",
                      mock(Path.class)),
                module);
}

代码示例来源:origin: org.uberfire/uberfire-project-builder

@Override
  public String getDescription() {
    return "Batch incremental build [" + e.getKey().getModuleName() + "]";
  }
});

代码示例来源:origin: org.uberfire/uberfire-project-backend

@Override
public Package resolveDefaultWorkspacePackage(final Module module) {
  final Path moduleRootPath = module.getRootPath();
  final GAV gav = module.getPom().getGav();
  final String defaultWorkspacePackagePath = getDefaultWorkspacePath(gav);
  final org.uberfire.java.nio.file.Path defaultWorkspacePath = Paths.convert(moduleRootPath).resolve(MAIN_RESOURCES_PATH + "/" + defaultWorkspacePackagePath);
  return resolvePackage(Paths.convert(defaultWorkspacePath));
}

代码示例来源:origin: kiegroup/appformer

@Test
  public void nameNotSetGAVNotSet() throws Exception {
    final POM pom = new POM();
    final Path rootPath = mock(Path.class);
    doReturn("myProject").when(rootPath).getFileName();

    final Module module = new Module(rootPath,
                     mock(Path.class),
                     pom);

    assertEquals("myProject",
           module.getModuleName());
  }
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-editor-client

private GAV projectGAV() {
  return activeModule().getPom().getGav();
}

代码示例来源:origin: org.uberfire/uberfire-project-client

private Module getMockModule() {
    return new Module(mock(Path.class),
             mock(Path.class),
             new POM());
  }
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-datasource-mgmt-client

private boolean hasChanged(final Module module) {
    return activeModule != null ? !activeModule.equals(module) : module != null;
  }
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-client

private TileWidget createProjectWidget(final WorkspaceProject project) {
  final TileWidget tileWidget = tileWidgets.get();
  if (project.getMainModule() != null) {
    final POM pom = project.getMainModule().getPom();
    tileWidget.init(project.getName(),
            pom != null ? pom.getDescription() : "",
            String.valueOf(project.getMainModule().getNumberOfAssets()),
            view.getNumberOfAssetsMessage(project.getMainModule().getNumberOfAssets()),
            selectCommand(project));
  } else {
    tileWidget.init(project.getName(),
            "",
            "0",
            "0",
            selectCommand(project));
  }
  return tileWidget;
}

代码示例来源:origin: kiegroup/appformer

private Module mockModule(final String myOldProject,
               final Path myOldProjectRootPath) {
    final Module module = mock(Module.class);
    when(module.getModuleName()).thenReturn(myOldProject);
    when(module.getRootPath()).thenReturn(myOldProjectRootPath);
    return module;
  }
}

代码示例来源:origin: kiegroup/appformer

@Override
  public String getDescription() {
    return "Batch incremental build [" + e.getKey().getModuleName() + "]";
  }
});

代码示例来源:origin: kiegroup/appformer

@Override
public Package resolveDefaultWorkspacePackage(final Module module) {
  final Path moduleRootPath = module.getRootPath();
  final GAV gav = module.getPom().getGav();
  final String defaultWorkspacePackagePath = getDefaultWorkspacePath(gav);
  final org.uberfire.java.nio.file.Path defaultWorkspacePath = Paths.convert(moduleRootPath).resolve(MAIN_RESOURCES_PATH + "/" + defaultWorkspacePackagePath);
  return resolvePackage(Paths.convert(defaultWorkspacePath));
}

代码示例来源:origin: kiegroup/appformer

@Test
public void nameNotSetUseArtifactId() throws Exception {
  final POM pom = new POM(new GAV("groupId",
                  "artifactId",
                  "version"));
  final Module module = new Module(mock(Path.class),
                   mock(Path.class),
                   pom);
  assertEquals("artifactId",
         module.getModuleName());
}

代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend

@Test
public void testResolveModuleWithChildPath() throws Exception {
  final Bean moduleServiceBean = (Bean) beanManager.getBeans(KieModuleService.class).iterator().next();
  final CreationalContext cc = beanManager.createCreationalContext(moduleServiceBean);
  final KieModuleService moduleService = (KieModuleService) beanManager.getReference(moduleServiceBean,
                                            KieModuleService.class,
                                            cc);
  final URL testUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureInvalidNoPOM/src");
  final org.uberfire.java.nio.file.Path nioTestPath = fs.getPath(testUrl.toURI());
  final Path testPath = paths.convert(nioTestPath);
  final Module result = moduleService.resolveModule(testPath);
  assertEquals("org.kie.workbench.services", result.getPom().getGav().getGroupId());
}

代码示例来源:origin: kiegroup/appformer

private Module getMockModule() {
    return new Module(mock(Path.class),
             mock(Path.class),
             new POM());
  }
}

相关文章