artur-shaik / vim-javacomplete2

DEPRECATED in favor of jc.nvim
Vim License
973 stars 83 forks source link

Completion not working - maven project with local .classpath #340

Closed noenthu closed 7 years ago

noenthu commented 7 years ago

Actual behavior (Required!)

Please pardon my lack of experience with Java On an existing project - managed using maven

The autocomplete feature is not triggering unless I remove/rename the .classpath

with .classpath present :echo g:JavaComplete_LibsPath .:/home/noenthu/workspace/project/target/classes:/home/noenthu/workspace/project/target/test-classes:/home/noenthu/workspace/project/target/classes

after removing/renaming the .classpath :echo g:JavaComplete_LibsPath ./home/noenthu/.m2/repository..................................

Expected behavior (Required!)

Completion should work leveraging the classpath that is generated by Maven and ignore that set in .classpath

The steps to reproduce actual behavior (Required!)

  1. create a mvn project through cli
  2. add a few dependencies in pom.xml
  3. mvn clean && mvn package
  4. Autocomplete works fine if editing the files
  5. Open the project in Eclipse (this generated a .classpath)
  6. Completion no longer works

Environment (Required!)

Q&A

artur-shaik commented 7 years ago

There is variable g:JavaComplete_ClasspathGenerationOrder. You can change order like this:

let g:JavaComplete_ClasspathGenerationOrder = ['Maven', 'Eclipse', 'Gradle']

This should fix you issue.

noenthu commented 7 years ago

Let me test it out. I'll get back shortly.

artur-shaik commented 7 years ago

@noenthu not so shortly :smile:

artur-shaik commented 7 years ago

Feel free to reopen.

noenthu commented 7 years ago

@artur-shaik sorry for not getting back. Confirming that the order change fixed my issue!