Skip to content

Instantly share code, notes, and snippets.

@soucekv
soucekv / build.gradle
Last active September 26, 2022 11:15
Gradle checkstyle with suppression filter module
//Gist note this is snippet from root build.gradle in project with subprojects
checkstyle {
// use one common config file for all subprojects
configFile = project(':').file('config/checkstyle/checkstyle.xml')
configProperties = [ "suppressionFile" : project(':').file('config/checkstyle/suppressions.xml')]
}
public static WebArchive prepareArchive() throws Exception {
WebArchive war = ShrinkWrap.create(); //parms omitted
//add dependency to ShrinkWrap Resolver library
GenericArchive mockitoLib = Maven.configureResolver()
.resolve("org.mockito:mockito-all:1.8.4")
.withTransitivity().asSingle(GenericArchive.class);
war.addAsLibraries(mockitoLib);
}