Findbugs and PMD plugins on Gradle - gradle

is it possible to generate only one html file for all modules (one for Findbugs and another for PMD), so I could upload somewhere those two html file for review?

I don't think Gradle itself supports combining these reports; however, you should be able to do it manually with some XSLT -- http://www.sw-engineering-candies.com/blog-1/howtotransformtheresultsfromfindbugscheckstyleandpmdintoasinglehtmlreportwithxslt20andjava

Related

Findbugs maven scan new code only

I am looking for a way to scan only new code of a project with the findbugs plugin for maven but I can't seem to figure out how.
There is no such way to scan only new code with the existing Findbugs mavne plugin.
You would need to develop your own that would check your SCM tool and run the check only on given files.
If you are running Findbugs on either Jenkins or SonarQube, you can view a report of the difference between two scans.

Is there a Maven plugin listing all JUnit tests in a multi module project

Is there any maven plugin - or non-maven tool - out there which would browse a multi-modules project and return me a list of all existing JUnit testcases (ideally presented per module) in a usable form?
I want to be able to work on that list and distribute my tests across multiple hosts.
I checked surefire documentation and I'm surprised that it doesn't seem to be able to do that.
There's a .../target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst in a Maven project.
You can use the GMavenPlus Plugin and Walking the File Tree to gather these files and put their content where you want.
Another option is to develop an own Maven plugin that does the same.

Is it possible to use wro4j to parse files and generate 'sass' versions of css without applying any bundling?

We are trying to run a SASS parser over our CSS files as part of our Maven build, but do not want them to be bundled together at the same time during this phase of the Maven life cycle.
However, I cannot see a simple way of using wro4J to do this without specifying each individual file as its own bundlem which just doesn't feel right. Have I missed some configurationm or is bundling so much at the core of the design of wro4J that it must be used like this?
This feature is not supported by wro4j yet, but it is planned to be added in future. In the meantime, you can use SassCssProcessor with a custom maven plugin which just applies the processor on each resource from a configured folder. The link to the issue describing the feature you need: https://github.com/wro4j/wro4j/issues/583

In a maven project, is it possible to use a plugin just built within the same project?

Suppose you have some sort of input files which are to be processed in some custom way (even the file format is very particular to the package of files in question).
To process them I decide to make a maven plugin, which happens to be useful only in the context of these files.
Is it possible to have them all (the afore mentioned files and source code for the plugin) in one project, build the plugin, run the plugin over the input files and collect its output as the output of this project?
Short answer is you can't, because Maven resolves plugin classpath on start.
However you can create separate modules, first being a plugin and second would use that plugin to process files. Both modules can be invoked from parent pom.

How to use auto_import feature with FreeMarker and maven or ant (not servlet)

I'd like to test using freemarker to automatically build my html files at compile time (not use the servlet) and want to use the auto_import feature so I don't have to re define the template for each file. I can either use ANT or Maven. How do you use the auto_import feature to automatically load templates within FreeMarker using either ANT or Maven?
auto_imports is just one of the many FreeMarker settings, and it has nothing to do with servlets, Maven or Ant. So if you can process the files with Ant or Maven (one way is using the Maven FMPP plugin or the Ant FMPP task), then you should be able to use use auto_imports as well.
Update: There's an issue with FMPP (until 0.9.15 is released): it doesn't know this setting, so you can't set it through FMPP. But instead it has "Header and footer choosing", which is even more flexible. See: http://fmpp.sourceforge.net/settings.html
Have you tried FMPP?
FMPP is a general-purpose text file preprocessor tool that uses FreeMarker templates.
It can be used via command-line or Ant and might provide all the features you need.

Resources