Live data from Hacker News

Java Build Systems - a sad state of affairs

grok-code.com

21–30 of 45 posts

Re: Java Build Systems - a sad state of affairs

#21
post #15
post #2

The article makes no mention of the solutions implemented in the newer languages on the JVM: - Groovy has Gant ( http://gant.codehaus.org/ ) - Clojure has Lancet ( http://github.com/stuarthalloway/lancet ) Both of these avoid the "XML tag soup" problem.

I believe on the Clojure side, leiningen is the preferred tool of choice: http://github.com/technomancy/leiningen

Leiningen? Awesome! I mean the literary reference, I have no idea what the program is like.

Re: Java Build Systems - a sad state of affairs

#22

Sometimes I suspect that the amount of time spent on build issues, IDE configuration, continuous integration, version control, and dependency management approaches half the total time spent on the project.

I think that one of big reasons people jump to new languages like Ruby is that there isn't all this cruft. It may not be related to the build system but just look at logging in java versus logging in Ruby. I know everybody likes to talk about the advanced features of the Ruby language but I can't help but think that much of the productivity boost comes from getting rid of this stuff.

Re: Java Build Systems - a sad state of affairs

#23
I also have my own build system, fbuild:

http://felix-lang.org/tags/fbuild

That has some basic support for Java. I'm using Python3 for my dsl. Here's a dummy example of how to use it (from http://github.com/erickt/fbuild/tree/master/examples/java):

    import fbuild.builders.java
    
    def build(ctx):
        java = fbuild.builders.java.Builder(ctx)
    
        lib = java.build_lib('lib.jar', ['World.java'])
        exe = java.build_lib('exe.jar', ['HelloWorld.java'], classpaths=[lib])

        ctx.logger.log(' * running %s:' % exe)
        java.run_class('HelloWorld', classpaths=[lib, exe])
I haven't had much demand for Java support, but it probably wouldn't be that difficult to extend it to download from a maven repository.

Re: Java Build Systems - a sad state of affairs

#25
post #9

There is buildr as well http://buildr.apache.org/ It is built on ruby and follows the Convention over Configuration route. Which keeps the build file quite small. It has hooks into maven and can be run on jruby or ruby

buildr is actually an extension of rake. It essentially adds tasks for building Java projects (classpaths, libraries, etc) and for packing standard formats (jar, war, ear, etc). I've been using it for a while now and it's great.

Re: Java Build Systems - a sad state of affairs

#26
post #16

I still use Makefiles, and I like it!

There's something to be said for relatively simple tool like make. It can be a lot easier to understand what's going on with Make because it eliminates the layers of stuff between the build script and the actual commands that are run. That's not to say that it's possible to write inscrutable Makefiles.

Java presents a lot of problems for make (multiple classes from a single java file, JNI produced files, circular class references, package to package dependencies).

Re: Java Build Systems - a sad state of affairs

#27
What's mentioned as drawbacks are powerful features Maven provides to handle the project/plugin dependencies better. It takes a bit of understanding and experience to appreciate these features and to use them effectively. I've used Maven the right way in one of the biggest enterprise environments as well as a couple of startups and the results have been nothing short of phenomenal. Am still baffled by how most of the expert Java/JEE programmers have very little knowledge about how Maven works.

Re: Java Build Systems - a sad state of affairs

#28

What's mentioned as drawbacks are powerful features Maven provides to handle the project/plugin dependencies better. It takes a bit of understanding and experience to appreciate these features and to use them effectively. I've used Maven the right way in one of the biggest enterprise environments as well as a couple of startups and the results have been nothing short of phenomenal. Am still baffled by how most of the…

It takes a bit of understanding and experience to appreciate these features and to use them effectively.

That would be the reason why most expert JEE folks aren't getting Maven. It's not a short or easy learning curve. even on a good day with good folks to help you wade through it.

That said, Maven's dependency management engine alone is worth the price of admission. Bye-bye JAR hell. But the integrated build/release/tag/version features are the real treat once you get that far...

Re: Java Build Systems - a sad state of affairs

#29
post #17

Or maybe you want to loop through a set of files and perform a set of operations on them. If you did start putting clever code into Ant files, they'd get so huge they'd be unmanageable. It's really really easy to just write your own Ant plugins in Java. Then your build files are very straightforward and readable, and just look like a set of simple file operations and method calls. Then Ant becomes really powerful - y…

If you have to drop into raw Java to accomplish anything exceptional, it largely defeats the purpose of build scripting.

Re: Java Build Systems - a sad state of affairs

#30
post #7

Is there any build system that doesn't have it's problems? edit: The discussion on Reddit points out many details about Maven that the author has gotten wrong: http://www.reddit.com/r/programming/comments/dmu26/java_buil...

Exactly. I'm mostly a C++ programmer and I have yet to find a build system that I'd like enough to actually use even in my small hobby projects.
Post reply on HN