How do I run facebook infer for my maven project?

2.8k Views Asked by At

As mentioned in the documentation, I tried running

infer -- mvn compile

on my maven project. It complains as

[ERROR] Javac compilation error with:
['javac', '-g', '-d', ... <list of all jars> ...'-g', '-nowarn', '-target', '1.8', '-source', '1.8', '-encoding', 'UTF-8']
javac: no source files
Usage: javac <options> <source files>

Am I missing anything?

2

There are 2 best solutions below

1
Dzidas On

I works for me like this:

infer -- mvn package -Pdev

or

infer -- mvn -Dtest=DatabaseExportXlsTest test
0
Chris Wininger On

infer -- mvn clean package works for me.

The clean is important. If I run it without clean, I get Nothing to compile. Try cleaning the build first.

I suspect you could add -DskipTests, i.e. infer -- mvn clean package -DskipTests` to speed the build if you don't care about issues in your tests