SimonScholz / report-aggregator

This project should be used to aggregate the reports of different code analysis tools, like SpotBugs, PMD, Checkstyle and more...
Apache License 2.0
4 stars 3 forks source link

Nothing gets aggreated. #2

Open stealthrabbi opened 4 years ago

stealthrabbi commented 4 years ago

THe default names of spotbugs files is main.xml, test.xml. This plugin doesn't find those files according to the documentation, nor does there seem to be a way to change what files it looks for.

SimonScholz commented 4 years ago

It seems that it looks for spotbugsXml.xml in the projects subdirectories.

See https://github.com/SimonScholz/report-aggregator/blob/42b6e83ca5b61e299de4e610c5837a1208d6bdc7/report-aggregator-gradle/src/main/java/com/simonscholz/report/service/SpotBugsService.java#L36

It already been 2 years ago since I worked on this gradle plugin, but several customers are using this gradle plugin to generate these reports. Are you sure you properly setup spotbugs?

And you´re right I unfortunately hard coded the file name to be spotbugsXml.xml. Sorry for that. I can change that if that helps you. Would it?

Do you have a sample project, where it can be tested? Unfortunately I do not have access to the customers using this plugin any more...

stealthrabbi commented 4 years ago

I wonder if you're basing this off of an older version of spotbugs? Itd efinitely makes the files in build\reports\spotbugs\main.xml \ test.xml

simon-gs commented 3 years ago

I have same issue with aggregation as @stealthrabbi. What @stealthrabbi mentioned about default report location and name is correct. After reading your code, I understand the plugin is expecting spotbugsXml.xm in subfolders of rootDirectory. So I renamed my main.xml to spotbugsXml.xm and put it in multiple level of its sub folders. None works. File SpotBugsAggregated.xml was generated in rootDirectory by Gradle task 'aggregateSpotBugsFiles'. But its content is like below that has no real data
===generated file SpotBugsAggregated.xml ===== <?xml version="1.0" encoding="UTF-8"?> <AggregatedSpotBugs xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" timestamp="2021-01-06T00:24:29.796-05:00" spotbugsFilesCount="0"/>

My build.gradle file sitting in rootDirectory is like below (only spotbugs related content is listed)

==== partial of build.gradle related to spotbugs ======= plugins { id 'com.simonscholz.reports' version '0.0.1' id 'com.github.spotbugs' version '4.5.0' }

subprojects { //spotbugs apply plugin: 'com.github.spotbugs'

//Spotbugs
spotbugsMain {
    reports {
        xml {
            enabled = true
        }
    }
}

spotbugs {
    maxHeapSize = "1g"
       toolVersion = '4.1.4'
       ignoreFailures = true
       effort = "max"
}

dependencies {
          spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.10.1'

}

}

I feel like it might be the issue with xml file. So I attached a short version of my spotbugsXml.xml. It has all the ingredients but with less data. (Have to rename to spotbugsXml.txt for upload).
spotbugsXml.txt