/** * Returns a string representation of the errors. * * @return a string representation of the errors. */ public String getErrorsAsString() { if ( !hasErrors() ) { return null; } StringBuilder message = new StringBuilder(); for ( String key : errors.keySet() ) { message.append( errors.get( key ) ); message.append( LS ); } return message.toString(); }
/** * Returns a string representation of the errors. * * @return a string representation of the errors. */ public String getErrorsAsString() { if ( !hasErrors() ) { return null; } StringBuffer message = new StringBuffer(); for ( Iterator i = errors.iterator(); i.hasNext(); ) { String error = (String) i.next(); message.append( error ); message.append( "\n" ); } return message.toString(); } }
if ( result.hasErrors() )
public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition ) throws ContinuumBuildExecutorException { File f = getPomFile( getBuildFileForProject( project, buildDefinition ), workingDirectory ); if ( !f.exists() ) { throw new ContinuumBuildExecutorException( "Could not find Maven project descriptor." ); } ContinuumProjectBuildingResult result = new ContinuumProjectBuildingResult(); builderHelper.mapMetadataToProject( result, f, project ); if ( result.hasErrors() ) { throw new ContinuumBuildExecutorException( "Error while mapping metadata:" + result.getErrorsAsString() ); } }
if ( result.hasErrors() )
@Override public MavenProject getMavenProject( File workingDirectory, BuildDefinition buildDefinition ) throws ContinuumAgentBuildExecutorException { ContinuumProjectBuildingResult result = new ContinuumProjectBuildingResult(); File f = getPomFile( getBuildFileForProject( buildDefinition ), workingDirectory ); if ( !f.exists() ) { throw new ContinuumAgentBuildExecutorException( "Could not find Maven project descriptor '" + f + "'." ); } MavenProject project = buildAgentMavenBuilderHelper.getMavenProject( result, f ); if ( result.hasErrors() ) { throw new ContinuumAgentBuildExecutorException( "Unable to read the Maven project descriptor '" + f + "': " + result.getErrorsAsString() ); } return project; }
private MavenProject getMavenProject( Project continuumProject, File workingDirectory, BuildDefinition buildDefinition ) throws ContinuumBuildExecutorException { ContinuumProjectBuildingResult result = new ContinuumProjectBuildingResult(); File f = getPomFile( getBuildFileForProject( continuumProject, buildDefinition ), workingDirectory ); if ( !f.exists() ) { throw new ContinuumBuildExecutorException( "Could not find Maven project descriptor '" + f + "'." ); } MavenProject project = builderHelper.getMavenProject( result, f ); if ( result.hasErrors() ) { throw new ContinuumBuildExecutorException( "Unable to read the Maven project descriptor '" + f + "': " + result.getErrorsAsString() ); } return project; }
public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition, ScmResult scmResult ) throws ContinuumBuildExecutorException { File f = getPomFile( getBuildFileForProject( project, buildDefinition ), workingDirectory ); if ( !f.exists() ) { throw new ContinuumBuildExecutorException( "Could not find Maven project descriptor." ); } ContinuumProjectBuildingResult result = new ContinuumProjectBuildingResult(); boolean update = isDescriptionUpdated( buildDefinition, scmResult, project ); builderHelper.mapMetadataToProject( result, f, project, update ); if ( result.hasErrors() ) { throw new ContinuumBuildExecutorException( "Error while mapping metadata:" + result.getErrorsAsString() ); } }
public void updateProjectFromWorkingDirectory( File workingDirectory, Project project, BuildDefinition buildDefinition ) throws ContinuumAgentBuildExecutorException { File f = getPomFile( getBuildFileForProject( buildDefinition ), workingDirectory ); if ( !f.exists() ) { throw new ContinuumAgentBuildExecutorException( "Could not find Maven project descriptor." ); } ContinuumProjectBuildingResult result = new ContinuumProjectBuildingResult(); buildAgentMavenBuilderHelper.mapMetadataToProject( result, f, project ); if ( result.hasErrors() ) { throw new ContinuumAgentBuildExecutorException( "Error while mapping metadata:" + result.getErrorsAsString() ); } else { updateProject( project ); } }
if ( result.hasErrors() )
if ( result.hasErrors() )
if ( result.hasErrors() )
if ( result.hasErrors() )
if ( result.hasErrors() )
if ( result.hasErrors() )
if ( result.hasErrors() )