Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nothing gets aggreated. #2

Open
stealthrabbi opened this issue Jan 3, 2020 · 3 comments
Open

Nothing gets aggreated. #2

stealthrabbi opened this issue Jan 3, 2020 · 3 comments

Comments

@stealthrabbi
Copy link

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
Copy link
Owner

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

See

List<File> spotBugsFiles = directories.stream().map(f -> new File(f, "spotbugsXml.xml")).filter(File::exists)

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
Copy link
Author

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
Copy link

simon-gs commented Jan 6, 2021

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 =====

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants