@Override void postExecute(MavenProject project, MojoInfo info, Exception exception) throws IOException, InterruptedException, AbortException { executedMojos.add(new ExecutedMojo(info,System.currentTimeMillis()-startTime)); for (MavenReporter r : reporters) if(!r.postExecute(buildProxy,project,info,listener,exception)) throw new AbortException(r+" failed"); }
void postExecute(MavenProject project, MojoInfo mojoInfo, Exception exception) throws IOException, InterruptedException, hudson.maven.agent.AbortException { ModuleName name = new ModuleName(project); List<ExecutedMojo> mojoList = executedMojos.get(name); if(mojoList==null) executedMojos.put(name,mojoList=new ArrayList<ExecutedMojo>()); mojoList.add(new ExecutedMojo(mojoInfo,System.currentTimeMillis()-mojoStartTime)); MavenBuildProxy2 proxy = proxies.get(name); for (MavenReporter r : reporters.get(name)) if(!r.postExecute(proxy,project,mojoInfo,listener,exception)) throw new hudson.maven.agent.AbortException(r+" failed"); if(exception!=null) proxy.setResult(Result.FAILURE); }
@Override void postExecute(MavenProject project, MojoInfo info, Exception exception) throws IOException, InterruptedException, AbortException { executedMojos.add(new ExecutedMojo(info,System.currentTimeMillis()-startTime)); for (MavenReporter r : reporters.get(moduleName)){ if(!r.postExecute(buildProxy,project,info,listener,exception)) { throw new AbortException(r+" failed"); } else if (r instanceof TestFailureDetector) { if(((TestFailureDetector) r).hasTestFailures()) { hasTestFailures.compareAndSet(false, true); } } } }
/** * Record how long it took to run this mojo. */ private void recordExecutionTime(ExecutionEvent event, MojoInfo mojoInfo) { MavenProject p = event.getProject(); List<ExecutedMojo> m = executedMojosPerModule.get(new ModuleName(p)); if (m==null) // defensive check executedMojosPerModule.put(new ModuleName(p), m=new CopyOnWriteArrayList<>()); Long startTime = getMojoStartTime( event.getProject() ); m.add(new ExecutedMojo( mojoInfo, startTime == null ? 0 : System.currentTimeMillis() - startTime )); }
void postExecute(MavenProject project, MojoInfo mojoInfo, Exception exception) throws IOException, InterruptedException, hudson.maven.agent.AbortException { ModuleName name = new ModuleName(project); List<ExecutedMojo> mojoList = executedMojos.get(name); if(mojoList==null) executedMojos.put(name,mojoList=new ArrayList<>()); mojoList.add(new ExecutedMojo(mojoInfo,System.currentTimeMillis()-mojoStartTime)); MavenBuildProxy2 proxy = proxies.get(name); for (MavenReporter r : reporters.get(name)){ if(!r.postExecute(proxy,project,mojoInfo,listener,exception)) { throw new hudson.maven.agent.AbortException(r+" failed"); } else if (r instanceof TestFailureDetector) { if(((TestFailureDetector) r).hasTestFailures()) { hasTestFailures.compareAndSet(false, true); } } } if(exception!=null) proxy.setResult(Result.FAILURE); }
/** * Lots of {@link ExecutedMojo}s tend to have the same groupId, artifactId, etc., so interning them help * with memory consumption. * * TODO: better if XStream has a declarative way of marking fields as "target for intern". */ ExecutedMojo readResolve() { return new ExecutedMojo(intern(groupId),intern(artifactId),intern(version),intern(goal),intern(executionId),duration,intern(digest)); }
new ExecutedMojo( mojoInfo, startTime == null ? 0 : endTime.getTime() - startTime.longValue() ); this.executedMojosPerModule.get( new ModuleName( mavenProject.getGroupId(), mavenProject.getArtifactId() ) ).add( executedMojo );
/** * Lots of {@link ExecutedMojo}s tend to have the same groupId, artifactId, etc., so interning them help * with memory consumption. * * TODO: better if XStream has a declarative way of marking fields as "target for intern". */ protected Object readResolve() { return new ExecutedMojo(intern(groupId),intern(artifactId),intern(version),intern(goal),intern(executionId),duration,intern(digest)); }
new ExecutedMojo( mojoInfo, startTime == null ? 0 : endTime.getTime() - startTime.longValue() ); this.executedMojosPerModule.get( new ModuleName( mavenProject.getGroupId(), mavenProject.getArtifactId() ) ).add( executedMojo );