8

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?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Apurv
  • 4,458
  • 2
  • 21
  • 31
  • 1
    There is a maven plugin you might want to checkout: [anthemengineering/infer-maven-plugin](https://github.com/anthemengineering/infer-maven-plugin) – mucaho Apr 20 '16 at 14:42
  • 2
    That `infer-maven-plugin` is dead. – Sri Mar 06 '17 at 04:33

2 Answers2

5

I works for me like this:

infer -- mvn package -Pdev

or

infer -- mvn -Dtest=DatabaseExportXlsTest test
Dzidas
  • 305
  • 4
  • 13
  • Thanks for your answer, I still get the same error with the first command. It seems you have some kind of profile named "dev" in your pom.xml I am just looking for how I can use infer to tell about all problems in all of my source code. – Apurv Jun 12 '15 at 12:50
1

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

Chris Wininger
  • 651
  • 8
  • 13