Search in sources :

Example 1 with ViolationsCollector

use of hudson.plugins.violations.ViolationsCollector in project violations-plugin by jenkinsci.

the class ViolationsMavenReporter method end.

@Override
public boolean end(MavenBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
    registered = false;
    FilePath htmlPath = new FilePath(new File(build.getProject().getRootDir(), VIOLATIONS));
    FilePath targetPath = new FilePath(new File(build.getRootDir(), VIOLATIONS));
    FilePath workspace = build.getWorkspace();
    if (workspace == null) {
        MavenModuleSetBuild parent = build.getModuleSetBuild();
        throw new IOException("No workspace for " + build + "; parent workspace: " + (parent != null ? parent.getWorkspace() : "N/A") + "; builtOnStr=" + build.getBuiltOnStr() + "; builtOn=" + build.getBuiltOn());
    }
    ViolationsReport report = workspace.act(new ViolationsCollector(true, targetPath, htmlPath, config));
    report.setConfig(config);
    report.setBuild(build);
    report.setBuildResult();
    ViolationsBuildAction buildAction = getCreateBuildAction(build);
    buildAction.setReport(report);
    return true;
}
Also used : FilePath(hudson.FilePath) MavenModuleSetBuild(hudson.maven.MavenModuleSetBuild) ViolationsBuildAction(hudson.plugins.violations.ViolationsBuildAction) ViolationsReport(hudson.plugins.violations.ViolationsReport) IOException(java.io.IOException) File(java.io.File) ViolationsCollector(hudson.plugins.violations.ViolationsCollector)

Aggregations

FilePath (hudson.FilePath)1 MavenModuleSetBuild (hudson.maven.MavenModuleSetBuild)1 ViolationsBuildAction (hudson.plugins.violations.ViolationsBuildAction)1 ViolationsCollector (hudson.plugins.violations.ViolationsCollector)1 ViolationsReport (hudson.plugins.violations.ViolationsReport)1 File (java.io.File)1 IOException (java.io.IOException)1