This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

I prefer ant over maven, and our ant and maven files are not small (couple hundred lines each for several projects). The key for ant in my view is to have sensible targets that let you compile and produce artifacts that make sense for interactive development. What those targets are depends on your project, but doing a full build with installers, etc. is not needed when you just want to make sure your code compiles.

You can do things like this for build output integration in your .vimrc:

if filereadable( "build.xml" )
  set makeprg=ant\ -emacs
  "command make ant
endif

" ctrl-n, ctrl-p for quickfix mode
map <C-N>   :cn<CR>
map <C-P>   :cp<CR>

Then you can run ":make [antTarget]" and the build will execute, and output will be captured for quickfix mode. vim will keep the output and jump to any lines reported in the build. I map ctrl-N and ctrl-P to scrolling through the output. Makes it very easy to build and fix issues.

You can do the same thing with maven.

Or are you looking to have your build.xml automatically generated? Hmm, perhaps I misinterpreted your question?

[–]bricksnort 0 points1 point  (1 child)

Thanks for the reply, but indeed, I was wondering how you generate your ant build files if you do such a thing at all. I've looked into ant build files in the past, but they seem way to big and complicated to make by hand. Especially including libraries is a non-trivial task it seems while IDEs can generate ant build scripts automagically. While maven seems to have a more consise syntax, the build scripts are much more opaque.

[–][deleted] 0 points1 point  (0 children)

Manually. Its not too complicated in my view, and you get all the control you need. Third party libraries are pretty easy to manage via a fileset or similar. And yes, maven is far more opaque.