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

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

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

Project.getName介绍

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

代码示例

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

private void out( Project project, BuildResult build, String msg )
{
  System.out.println( "Build event for project '" + project.getName() + "':" + msg );
  if ( build != null && !StringUtils.isEmpty( build.getError() ) )
  {
    System.out.println( build.getError() );
  }
}

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

private void out( Project project, BuildResult build, String msg )
{
  System.out.println( "Build event for project '" + project.getName() + "':" + msg );
  if ( build != null && !StringUtils.isEmpty( build.getError() ) )
  {
    System.out.println( build.getError() );
  }
}

代码示例来源: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.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.maven.continuum/continuum-notifier-msn

getLogger().info( "No MSN recipients for '" + project.getName() + "'." );

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

private String generateMessage( Project project, BuildResult build )
  throws ContinuumException
{
  int state = project.getState();
  if ( build != null )
  {
    state = build.getState();
  }
  String message;
  if ( state == ContinuumProjectState.OK )
  {
    message = "BUILD SUCCESSFUL: " + project.getName();
  }
  else if ( state == ContinuumProjectState.FAILED )
  {
    message = "BUILD FAILURE: " + project.getName();
  }
  else if ( state == ContinuumProjectState.ERROR )
  {
    message = "BUILD ERROR: " + project.getName();
  }
  else
  {
    getLogger().warn( "Unknown build state " + state + " for project " + project.getId() );
    message = "ERROR: Unknown build state " + state + " for " + project.getName() + " project";
  }
  return message + " " + getReportUrl( project, build, configurationService );
}

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

public void assertProjectEquals( Project expected, Project actual )
{
  assertProjectEquals( expected.getName(), expected.getNotifiers(), expected.getVersion(), actual );
}

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

public void assertProjectEquals( Project expected, Project actual )
{
  assertProjectEquals( expected.getName(), expected.getNotifiers(), expected.getVersion(), actual );
}

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

private static String getProjectId( Project project )
{
  String groupId;
  String artifactId;
  if ( project.getGroupId() == null )
  {
    groupId = project.getName();
  }
  else
  {
    groupId = project.getGroupId();
  }
  if ( project.getArtifactId() == null )
  {
    artifactId = project.getName();
  }
  else
  {
    artifactId = project.getArtifactId();
  }
  return groupId + ":" + artifactId + ":" + project.getVersion();
}

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

/**
 * Checks out the sources to the specified directory.
 *
 * @param project The project to check out.
 * @throws ContinuumScmException Thrown in case of a exception while checking out the sources.
 */
public ScmResult checkOutProject( Project project, Map context )
  throws ContinuumScmException
{
  File workingDirectory = workingDirectoryService.getWorkingDirectory( project );
  if ( workingDirectory == null )
  {
    throw new ContinuumScmException( "The working directory for the project has to be set. Project: '" +
      project.getName() + "', id: '" + project.getId() + "'." );
  }
  return checkOut( project, workingDirectory, context );
}

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

private static String getProjectId( Project project )
{
  String groupId;
  String artifactId;
  if ( project.getGroupId() == null )
  {
    groupId = project.getName();
  }
  else
  {
    groupId = project.getGroupId();
  }
  if ( project.getArtifactId() == null )
  {
    artifactId = project.getName();
  }
  else
  {
    artifactId = project.getArtifactId();
  }
  String projectGroupId = "[" + project.getProjectGroup().getId() + "]";
  return projectGroupId + ":" + groupId + ":" + artifactId + ":" + project.getVersion();
}

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

public void execute( Map context )
  throws Exception
{
  Project project = ContinuumBuildAgentUtil.getProject( context );
  logger.info( "Updating project '" + project.getName() + "' from checkout." );
  BuildDefinition buildDefinition = ContinuumBuildAgentUtil.getBuildDefinition( context );
  File workingDirectory = buildAgentConfigurationService.getWorkingDirectory( project.getId() );
  ContinuumAgentBuildExecutor buildExecutor = buildAgentBuildExecutorManager.getBuildExecutor(
    project.getExecutorId() );
  buildExecutor.updateProjectFromWorkingDirectory( workingDirectory, project, buildDefinition );
}

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

public void assertProjectEquals( String name, List notifiers, String version, Project actual )
  {
    assertEquals( "project.name", name, actual.getName() );

//        assertEquals( "project.scmUrl", scmUrl, actual.getScmUrl() );

    if ( notifiers != null )
    {
      assertNotNull( "project.notifiers", actual.getNotifiers() );

      assertEquals( "project.notifiers.size", notifiers.size(), actual.getNotifiers().size() );

      for ( int i = 0; i < notifiers.size(); i++ )
      {
        ProjectNotifier notifier = (ProjectNotifier) notifiers.get( i );

        ProjectNotifier actualNotifier = (ProjectNotifier) actual.getNotifiers().get( i );

        assertEquals( "project.notifiers.notifier.type", notifier.getType(), actualNotifier.getType() );

        assertEquals( "project.notifiers.notifier.configuration.address",
               notifier.getConfiguration().get( "address" ),
               actualNotifier.getConfiguration().get( "address" ) );
      }
    }

    assertEquals( "project.version", version, actual.getVersion() );
  }

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

public void assertProjectEquals( String name, List<ProjectNotifier> notifiers, String version, Project actual )
  {
    assertEquals( "project.name", name, actual.getName() );

//        assertEquals( "project.scmUrl", scmUrl, actual.getScmUrl() );

    if ( notifiers != null )
    {
      assertNotNull( "project.notifiers", actual.getNotifiers() );

      assertEquals( "project.notifiers.size", notifiers.size(), actual.getNotifiers().size() );

      for ( int i = 0; i < notifiers.size(); i++ )
      {
        ProjectNotifier notifier = notifiers.get( i );

        ProjectNotifier actualNotifier = (ProjectNotifier) actual.getNotifiers().get( i );

        assertEquals( "project.notifiers.notifier.type", notifier.getType(), actualNotifier.getType() );

        assertEquals( "project.notifiers.notifier.configuration.address", notifier.getConfiguration().get(
          "address" ), actualNotifier.getConfiguration().get( "address" ) );
      }
    }

    assertEquals( "project.version", version, actual.getVersion() );
  }

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

public void execute( Map context )
    throws Exception
  {
    Project project = store.getProject( getProjectId( context ) );

    CheckOutTask checkOutTask =
      new CheckOutTask( project.getId(), workingDirectoryService.getWorkingDirectory( project ), project.getName() );

    checkOutQueue.put( checkOutTask );
  }
}

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

parallelBuildsManager.checkoutProject( project.getId(), project.getName(),
                    workingDirectoryService.getWorkingDirectory( project ), scmRootUrl,
                    scmUsername, scmPassword, defaultBuildDefinition,

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

public void execute( Map context )
  throws Exception
{
  Project project = ContinuumBuildAgentUtil.getProject( context );
  try
  {
    File workingDirectory = buildAgentConfigurationService.getWorkingDirectory( project.getId() );
    ContinuumScmConfiguration config = createScmConfiguration( project, workingDirectory );
    config.setLatestUpdateDate( ContinuumBuildAgentUtil.getLatestUpdateDate( context ) );
    getLogger().info( "Getting changeLog of project: " + project.getName() );
    ChangeLogScmResult changeLogResult = scm.changeLog( config );
    if ( !changeLogResult.isSuccess() )
    {
      getLogger().warn( "Error getting change log of project " + project.getName() );
      getLogger().warn( "Command Output: " + changeLogResult.getCommandOutput() );
      getLogger().warn( "Provider Message: " + changeLogResult.getProviderMessage() );
    }
    context.put( ContinuumBuildAgentUtil.KEY_LATEST_UPDATE_DATE, getLatestUpdateDate( changeLogResult ) );
  }
  catch ( ScmException e )
  {
    context.put( ContinuumBuildAgentUtil.KEY_LATEST_UPDATE_DATE, null );
    getLogger().error( e.getMessage(), e );
  }
}

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

getLogger().info( "Updating project '" + project.getName() + "' from checkout." );

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

public void execute( Map context )
    throws ContinuumStoreException, ContinuumException, ContinuumBuildExecutorException
  {
    Project project = getProject( context );

    project = store.getProjectWithAllDetails( project.getId() );

    getLogger().info( "Updating project '" + project.getName() + "' from checkout." );

    BuildDefinition buildDefinition = store.getBuildDefinition( getBuildDefinitionId( context ) );

    // ----------------------------------------------------------------------
    // Make a new descriptor
    // ----------------------------------------------------------------------

    ContinuumBuildExecutor builder = buildExecutorManager.getBuildExecutor( project.getExecutorId() );

    builder.updateProjectFromCheckOut( workingDirectoryService.getWorkingDirectory( project ), project,
                      buildDefinition );

    // ----------------------------------------------------------------------
    // Store the new descriptor
    // ----------------------------------------------------------------------

    store.updateProject( project );
  }
}

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

getLogger().info( "Remove project " + project.getName() + "(" + projectId + ")" );

相关文章

Project类方法