Add maven helper file; use maven wrapper if available instead of global 'mvn' executable

This commit is contained in:
fenuks
2019-12-09 23:38:53 +01:00
committed by fenuks
parent 96dcbd1f20
commit 7186b0437f
2 changed files with 52 additions and 7 deletions

View File

@@ -9,13 +9,7 @@ call ale#Set('java_javac_classpath', '')
call ale#Set('java_javac_sourcepath', '')
function! ale_linters#java#javac#RunWithImportPaths(buffer) abort
let l:command = ''
let l:pom_path = ale#path#FindNearestFile(a:buffer, 'pom.xml')
if !empty(l:pom_path) && executable('mvn')
let l:command = ale#path#CdString(fnamemodify(l:pom_path, ':h'))
\ . 'mvn dependency:build-classpath'
endif
let l:command = ale#maven#BuildClasspathCommand(a:buffer)
" Try to use Gradle if Maven isn't available.
if empty(l:command)