org.apache.maven.continuum.model.project.Project.getProjectGroup()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(10.9k)|赞(0)|评价(0)|浏览(143)

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

Project.getProjectGroup介绍

[英]Get null
[中]获取空值

代码示例

代码示例来源:origin: org.apache.maven.continuum/continuum-store

public List<Project> getProjectsWithDependenciesByGroupId( int projectGroupId )
{
  List<Project> allProjects =
    getAllObjectsDetached( Project.class, "name ascending", PROJECT_DEPENDENCIES_FETCH_GROUP );
  List<Project> groupProjects = new ArrayList<Project>();
  for ( Project project : allProjects )
  {
    if ( project.getProjectGroup().getId() == projectGroupId )
    {
      groupProjects.add( project );
    }
  }
  return groupProjects;
}

代码示例来源:origin: org.apache.maven.continuum/continuum-core

protected Properties getContinuumSystemProperties( Project project )
{
  Properties properties = new Properties();
  properties.setProperty( "continuum.project.group.name", project.getProjectGroup().getName() );
  properties.setProperty( "continuum.project.lastBuild.state", String.valueOf( project.getOldState() ) );
  properties.setProperty( "continuum.project.lastBuild.number", String.valueOf( project.getBuildNumber() ) );
  properties.setProperty( "continuum.project.nextBuild.number", String.valueOf( project.getBuildNumber() + 1 ) );
  return properties;
}

代码示例来源:origin: org.apache.continuum/continuum-core

protected Properties getContinuumSystemProperties( Project project )
{
  Properties properties = new Properties();
  properties.setProperty( "continuum.project.group.name", project.getProjectGroup().getName() );
  properties.setProperty( "continuum.project.lastBuild.state", String.valueOf( project.getOldState() ) );
  properties.setProperty( "continuum.project.lastBuild.number", String.valueOf( project.getBuildNumber() ) );
  properties.setProperty( "continuum.project.nextBuild.number", String.valueOf( project.getBuildNumber() + 1 ) );
  properties.setProperty( "continuum.project.id", String.valueOf( project.getId() ) );
  properties.setProperty( "continuum.project.name", project.getName() );
  properties.setProperty( "continuum.project.version", project.getVersion() );
  return properties;
}

代码示例来源:origin: org.apache.continuum/continuum-buildagent-core

protected Properties getContinuumSystemProperties( Project project )
{
  Properties properties = new Properties();
  properties.setProperty( "continuum.project.group.name", project.getProjectGroup().getName() );
  properties.setProperty( "continuum.project.lastBuild.state", String.valueOf( project.getOldState() ) );
  properties.setProperty( "continuum.project.lastBuild.number", String.valueOf( project.getBuildNumber() ) );
  properties.setProperty( "continuum.project.nextBuild.number", String.valueOf( project.getBuildNumber() + 1 ) );
  properties.setProperty( "continuum.project.id", String.valueOf( project.getId() ) );
  properties.setProperty( "continuum.project.name", project.getName() );
  properties.setProperty( "continuum.project.version", project.getVersion() );
  return properties;
}

代码示例来源:origin: org.apache.maven.continuum/continuum-store

public ProjectGroup getProjectGroupByProjectId( int projectId )
  throws ContinuumObjectNotFoundException
{
  try
  {
    return getProject( projectId ).getProjectGroup();
  }
  catch ( ContinuumStoreException e )
  {
    throw new ContinuumObjectNotFoundException(
      "unable to find project group containing project with id: " + projectId );
  }
}

代码示例来源:origin: org.apache.continuum/continuum-store

public ProjectGroup getProjectGroupByProjectId( int projectId )
  throws ContinuumObjectNotFoundException
{
  try
  {
    return getProject( projectId ).getProjectGroup();
  }
  catch ( ContinuumStoreException e )
  {
    throw new ContinuumObjectNotFoundException(
      "unable to find project group containing project with id: " + projectId );
  }
}

代码示例来源:origin: org.apache.continuum/continuum-store

public ProjectGroup getProjectGroupByProjectId( int projectId )
  throws ContinuumObjectNotFoundException
{
  try
  {
    return projectDao.getProject( projectId ).getProjectGroup();
  }
  catch ( ContinuumStoreException e )
  {
    throw new ContinuumObjectNotFoundException(
      "unable to find project group containing project with id: " + projectId );
  }
}

代码示例来源:origin: org.apache.continuum/continuum-commons

public File getWorkingDirectory( Project project, boolean shouldSet )
{
  ProjectGroup projectGroup = project.getProjectGroup();
  File f = new File( getChrootJailDirectory(), projectGroup.getGroupId() );
  f = new File( f, getConfigurationService().getWorkingDirectory().getPath() );
  return new File( f, Integer.toString( project.getId() ) );
}

代码示例来源:origin: org.apache.continuum/continuum-core

private Map createProjectMap( Project project )
{
  Map<String, Object> map = new HashMap<String, Object>();
  map.put( DistributedReleaseUtil.KEY_PROJECT_ID, project.getId() );
  map.put( DistributedReleaseUtil.KEY_GROUP_ID, project.getGroupId() );
  map.put( DistributedReleaseUtil.KEY_ARTIFACT_ID, project.getArtifactId() );
  map.put( DistributedReleaseUtil.KEY_SCM_URL, project.getScmUrl() );
  if ( project.getProjectGroup().getLocalRepository() != null )
  {
    map.put( DistributedReleaseUtil.KEY_LOCAL_REPOSITORY_NAME,
         project.getProjectGroup().getLocalRepository().getName() );
  }
  return map;
}

代码示例来源:origin: org.apache.continuum/data-management-jdo

private List<Project> getProjectsByGroupIdWithDependencies( PersistenceManagerFactory pmf, int projectGroupId )
{
  List<Project> allProjects = PlexusJdoUtils.getAllObjectsDetached( pmf.getPersistenceManager(), Project.class,
                                   "name ascending", "project-dependencies" );
  List<Project> groupProjects = new ArrayList<Project>();
  for ( Project project : allProjects )
  {
    if ( project.getProjectGroup().getId() == projectGroupId )
    {
      groupProjects.add( project );
    }
  }
  return groupProjects;
}

代码示例来源:origin: org.apache.continuum/continuum-xmlrpc-server

public ProjectSummary getProjectSummary( int projectId )
  throws ContinuumException
{
  org.apache.maven.continuum.model.project.Project project = continuum.getProject( projectId );
  checkViewProjectGroupAuthorization( project.getProjectGroup().getName() );
  return populateProjectSummary( project );
}

代码示例来源:origin: org.apache.maven.continuum/continuum-xmlrpc-server

public ProjectSummary getProjectSummary( int projectId )
  throws ContinuumException
{
  org.apache.maven.continuum.model.project.Project project = continuum.getProject( projectId );
  checkViewProjectGroupAuthorization( project.getProjectGroup().getName() );
  return populateProjectSummary( project );
}

代码示例来源:origin: org.apache.continuum/continuum-xmlrpc-server

public Project getProjectWithAllDetails( int projectId )
  throws ContinuumException
{
  org.apache.maven.continuum.model.project.Project project = continuum.getProjectWithAllDetails( projectId );
  checkViewProjectGroupAuthorization( project.getProjectGroup().getName() );
  return populateProject( project );
}

代码示例来源:origin: org.apache.maven.continuum/continuum-xmlrpc-server

public Project getProjectWithAllDetails( int projectId )
  throws ContinuumException
{
  org.apache.maven.continuum.model.project.Project project = continuum.getProjectWithAllDetails( projectId );
  checkViewProjectGroupAuthorization( project.getProjectGroup().getName() );
  return populateProject( project );
}

代码示例来源:origin: org.apache.continuum/continuum-core

int projectGroupId = project.getProjectGroup().getId();

代码示例来源:origin: org.apache.continuum/continuum-core

private void updateProjectScmRoot( ProjectScmRoot oldScmRoot, Project project )
  throws ContinuumException
{
  try
  {
    removeProjectScmRoot( oldScmRoot );
    ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRootByProjectGroupAndScmRootAddress(
      project.getProjectGroup().getId(), project.getScmUrl() );
    if ( scmRoot == null )
    {
      ProjectScmRoot newScmRoot = new ProjectScmRoot();
      if ( project.getScmUrl().equals( oldScmRoot.getScmRootAddress() ) )
      {
        BeanUtils.copyProperties( oldScmRoot, newScmRoot, new String[]{"id", "projectGroup"} );
      }
      else
      {
        newScmRoot.setScmRootAddress( project.getScmUrl() );
      }
      newScmRoot.setProjectGroup( project.getProjectGroup() );
      projectScmRootDao.addProjectScmRoot( newScmRoot );
    }
  }
  catch ( ContinuumStoreException ex )
  {
    throw logAndCreateException( "Error while updating project.", ex );
  }
}

代码示例来源:origin: org.apache.continuum/continuum-xmlrpc-server

public int releaseRollback( int projectId, String releaseId )
  throws Exception
{
  org.apache.maven.continuum.model.project.Project project = continuum.getProject( projectId );
  if ( project != null )
  {
    checkBuildProjectInGroupAuthorization( project.getProjectGroup().getName() );
    if ( continuum.getConfiguration().isDistributedBuildEnabled() )
    {
      continuum.getDistributedReleaseManager().releaseRollback( releaseId, projectId );
    }
    else
    {
      continuum.getReleaseManager().rollback( releaseId, continuum.getWorkingDirectory( projectId ).getPath(),
                          null );
      continuum.getReleaseManager().getPreparedReleases().remove( releaseId );
    }
    return 0;
  }
  else
  {
    throw new Exception( "Unable to rollback the release for '" + releaseId + "'" );
  }
}

代码示例来源:origin: org.apache.continuum/continuum-xmlrpc-server

public ReleaseListenerSummary getListener( int projectId, String releaseId )
  throws Exception
{
  org.apache.maven.continuum.model.project.Project project = continuum.getProject( projectId );
  if ( project != null )
  {
    checkBuildProjectInGroupAuthorization( project.getProjectGroup().getName() );
    if ( continuum.getConfiguration().isDistributedBuildEnabled() )
    {
      Map<String, Object> map = continuum.getDistributedReleaseManager().getListener( releaseId );
      return processListenerMap( map );
    }
    else
    {
      return populateReleaseListenerSummary( continuum.getReleaseManager().getListener( releaseId ) );
    }
  }
  else
  {
    throw new Exception( "Unable to get release listener for '" + releaseId + "'" );
  }
}

代码示例来源:origin: org.apache.continuum/continuum-test

public Project addProject( Project project )
  throws Exception
{
  ProjectGroup defaultProjectGroup = getDefaultProjectGroup();
  // ----------------------------------------------------------------------
  //
  // ----------------------------------------------------------------------
  ScmResult scmResult = new ScmResult();
  scmResult.setSuccess( true );
  scmResult.setCommandOutput( "commandOutput" );
  scmResult.setProviderMessage( "providerMessage" );
  project.setCheckoutResult( scmResult );
  defaultProjectGroup.addProject( project );
  projectGroupDao.updateProjectGroup( defaultProjectGroup );
  project = projectDao.getProject( project.getId() );
  assertNotNull( "project group == null", project.getProjectGroup() );
  return project;
}

代码示例来源:origin: org.apache.maven.continuum/continuum-test

public Project addProject( ContinuumStore store, Project project )
  throws Exception
{
  ProjectGroup defaultProjectGroup = getDefaultProjectGroup();
  // ----------------------------------------------------------------------
  //
  // ----------------------------------------------------------------------
  ScmResult scmResult = new ScmResult();
  scmResult.setSuccess( true );
  scmResult.setCommandOutput( "commandOutput" );
  scmResult.setProviderMessage( "providerMessage" );
  project.setCheckoutResult( scmResult );
  defaultProjectGroup.addProject( project );
  store.updateProjectGroup( defaultProjectGroup );
  project = store.getProject( project.getId() );
  assertNotNull( "project group == null", project.getProjectGroup() );
  return project;
}

相关文章

Project类方法