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

Cannot analyze maven project with "mvn build" #38

Closed
sans-github opened this Issue Jun 12, 2015 · 12 comments

Comments

Projects
None yet
9 participants
@sans-github

sans-github commented Jun 12, 2015

This issue is similar to what was reported earlier - Cannot analyze maven project?

I have a single module maven project with following structure
Project

  • src
  • test
  • conf
  • Readme.md
  • pom.xml

I ran "infer -- mvn build". It seems like a no-op. There is no ./infer-out folder as described on workflow. No other output whatsoever.

I have tried this on both java 6 and java 8

$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
$ javac -version
javac 1.6.0_65

$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
$ javac -version
javac 1.8.0_25

@yusuferisen

This comment has been minimized.

Show comment
Hide comment
@yusuferisen

yusuferisen Jun 12, 2015

We're having the same exact issue.
👍

yusuferisen commented Jun 12, 2015

We're having the same exact issue.
👍

@ericdcobb

This comment has been minimized.

Show comment
Hide comment
@ericdcobb

ericdcobb Jun 12, 2015

I see the same thing, but I do get some activity when I run:

infer -- mvn install

However I get an exception, I'm not sure if I should put this in a different issue.

I tried to clean up this error message to not include anything private to our project...

Fatal error: exception Sys_error("/Users/ericcobb/.m2/repository/com/google/http-client/google-http-client-jackson2/1.20.0/google-http-client-jackson2-1.20.0.jar: Too many open files")
[ERROR] Failure during frontend, original command was
.....(Very large original command here)

Traceback (most recent call last):
  File "/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/infer", line 142, in <module>
    main()
  File "/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/infer", line 119, in main
    capture_exitcode = imported_module.gen_instance(args, cmd).capture()
  File "/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/../lib/capture/mvn.py", line 59, in capture
    return util.run_commands(cmds)
  File "/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/../lib/capture/util.py", line 34, in run_commands
    if not cmd.start():
  File "/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 632, in start
    if self.capture() == os.EX_OK:
  File "/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 400, in capture
    return self.run_infer_frontend()
  File "/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 391, in run_infer_frontend
    self.args.analyzer
  File "/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 318, in run_command
    raise e
subprocess.CalledProcessError: Command '[u'/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/InferJava', u'-results_dir', u'/Users/ericcobb/Develop/project-name/infer-out', u'-verbose_out', '/var/folders/w1/0zldbv1x0x514z0nr7z9j1dh0000gn/T/javac_EXhHos.out', u'-models', u'/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/../lib/java/models.jar', u'-no-static_final']' returned non-zero exit status 2

java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

javac -version
javac 1.8.0_20

ericdcobb commented Jun 12, 2015

I see the same thing, but I do get some activity when I run:

infer -- mvn install

However I get an exception, I'm not sure if I should put this in a different issue.

I tried to clean up this error message to not include anything private to our project...

Fatal error: exception Sys_error("/Users/ericcobb/.m2/repository/com/google/http-client/google-http-client-jackson2/1.20.0/google-http-client-jackson2-1.20.0.jar: Too many open files")
[ERROR] Failure during frontend, original command was
.....(Very large original command here)

Traceback (most recent call last):
  File "/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/infer", line 142, in <module>
    main()
  File "/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/infer", line 119, in main
    capture_exitcode = imported_module.gen_instance(args, cmd).capture()
  File "/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/../lib/capture/mvn.py", line 59, in capture
    return util.run_commands(cmds)
  File "/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/../lib/capture/util.py", line 34, in run_commands
    if not cmd.start():
  File "/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 632, in start
    if self.capture() == os.EX_OK:
  File "/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 400, in capture
    return self.run_infer_frontend()
  File "/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 391, in run_infer_frontend
    self.args.analyzer
  File "/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 318, in run_command
    raise e
subprocess.CalledProcessError: Command '[u'/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/InferJava', u'-results_dir', u'/Users/ericcobb/Develop/project-name/infer-out', u'-verbose_out', '/var/folders/w1/0zldbv1x0x514z0nr7z9j1dh0000gn/T/javac_EXhHos.out', u'-models', u'/Users/ericcobb/Develop/tools/infer-osx-v0.1.0/infer/infer/bin/../lib/java/models.jar', u'-no-static_final']' returned non-zero exit status 2

java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

javac -version
javac 1.8.0_20

@MrThiago

This comment has been minimized.

Show comment
Hide comment
@MrThiago

MrThiago Jun 15, 2015

I am also having the same problem, Is does anyone knows how to run android project build on Eclipse and not gradlew ?

java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

infer --version
Infer version v0.1.0
Copyright 2009 - present Facebook. All Rights Reserved.

MrThiago commented Jun 15, 2015

I am also having the same problem, Is does anyone knows how to run android project build on Eclipse and not gradlew ?

java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

infer --version
Infer version v0.1.0
Copyright 2009 - present Facebook. All Rights Reserved.

@clinejj

This comment has been minimized.

Show comment
Hide comment
@clinejj

clinejj Jun 17, 2015

The too many open files problem appears to be an issue with OSX and Linux, not anything with infer. See this stack overflow: http://superuser.com/questions/827984/open-files-limit-does-not-work-as-before-in-osx-yosemite

We had the same issue with our projects, and after adjusting the files as described here for OSX we didn't get the issue anymore.

clinejj commented Jun 17, 2015

The too many open files problem appears to be an issue with OSX and Linux, not anything with infer. See this stack overflow: http://superuser.com/questions/827984/open-files-limit-does-not-work-as-before-in-osx-yosemite

We had the same issue with our projects, and after adjusting the files as described here for OSX we didn't get the issue anymore.

@sans-github

This comment has been minimized.

Show comment
Hide comment
@sans-github

sans-github Jun 17, 2015

I changed the settings from
kern.maxfiles: 12288
kern.maxfilesperproc: 10240
to
kern.maxfiles: 30000
kern.maxfilesperproc: 25000

Still nothing.

Mind sharing your configuration?

sans-github commented Jun 17, 2015

I changed the settings from
kern.maxfiles: 12288
kern.maxfilesperproc: 10240
to
kern.maxfiles: 30000
kern.maxfilesperproc: 25000

Still nothing.

Mind sharing your configuration?

@irpap irpap removed the java label Jun 18, 2015

@jvillard

This comment has been minimized.

Show comment
Hide comment
@jvillard

jvillard Jun 22, 2015

Contributor

@mesanjeeb: Someone reported successful settings here.

Otherwise you may have some luck with trying java and javac version 1.7.

Contributor

jvillard commented Jun 22, 2015

@mesanjeeb: Someone reported successful settings here.

Otherwise you may have some luck with trying java and javac version 1.7.

@sans-github

This comment has been minimized.

Show comment
Hide comment
@sans-github

sans-github Jun 22, 2015

@jvillard I'm probably going to wait(or possibly contribute) until kinks are cleared out. Java 7 may not be an option for us at the moment.

Thanks for the conversation.

sans-github commented Jun 22, 2015

@jvillard I'm probably going to wait(or possibly contribute) until kinks are cleared out. Java 7 may not be an option for us at the moment.

Thanks for the conversation.

@remagon

This comment has been minimized.

Show comment
Hide comment
@remagon

remagon Jun 24, 2015

same issue
got no output after run the commands
infer -- mvn clean
infer -- mvn package

java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

infer --version
Infer version v0.1.1
Copyright 2009 - present Facebook. All Rights Reserved.

remagon commented Jun 24, 2015

same issue
got no output after run the commands
infer -- mvn clean
infer -- mvn package

java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

infer --version
Infer version v0.1.1
Copyright 2009 - present Facebook. All Rights Reserved.

@adagios

This comment has been minimized.

Show comment
Hide comment
@adagios

adagios Jun 24, 2015

I'm having the same issue, but only on some projects. Some projects work correctly and on others I get no output whatsoever.

adagios commented Jun 24, 2015

I'm having the same issue, but only on some projects. Some projects work correctly and on others I get no output whatsoever.

@remagon

This comment has been minimized.

Show comment
Hide comment
@remagon

remagon Jun 25, 2015

@adagios
you are right
I tried to delete some maven plugin, It works

I think it's about this plugin and it's version is too low, with a new version it works also.

<plugin>  
    <groupId>org.apache.maven.plugins</groupId>  
    <artifactId>maven-compiler-plugin</artifactId>  
    <version>2.0.2</version>  
    <configuration>  
        <source>1.7</source>  
        <target>1.7</target>  
    </configuration>  
</plugin> 

remagon commented Jun 25, 2015

@adagios
you are right
I tried to delete some maven plugin, It works

I think it's about this plugin and it's version is too low, with a new version it works also.

<plugin>  
    <groupId>org.apache.maven.plugins</groupId>  
    <artifactId>maven-compiler-plugin</artifactId>  
    <version>2.0.2</version>  
    <configuration>  
        <source>1.7</source>  
        <target>1.7</target>  
    </configuration>  
</plugin> 
@adagios

This comment has been minimized.

Show comment
Hide comment
@adagios

adagios Jun 25, 2015

@remagon you're right, I updated the maven-compiler-plugin version and it started working!

adagios commented Jun 25, 2015

@remagon you're right, I updated the maven-compiler-plugin version and it started working!

@jvillard

This comment has been minimized.

Show comment
Hide comment
@jvillard

jvillard Aug 26, 2015

Contributor

Feel free to re-open if the issue is still there with the latest version of Infer and if @remagon's suggestion is not enough.

Contributor

jvillard commented Aug 26, 2015

Feel free to re-open if the issue is still there with the latest version of Infer and if @remagon's suggestion is not enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment