Path: csiph.com!eeepc.pasdenom.info!news.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: Markus Gessner Newsgroups: comp.lang.java.programmer Subject: Dependency resolution in Java builds Date: Tue, 08 Feb 2011 23:26:22 +0100 Message-ID: <87oc6mi2nl.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:FEN2LfDBp54ey15sZegmPfu7n+w= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Lines: 55 Organization: Arcor NNTP-Posting-Date: 08 Feb 2011 23:26:03 CET NNTP-Posting-Host: 2ec2cbd0.newsspool2.arcor-online.net X-Trace: DXC=4B^keiBcggk[F<50eo:0knA9EHlD;3Ycb4Fo<]lROoRa8kFB4BFjnACcZ@iRR=KndGfhe6d2;dIafn X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.java.programmer:25653 Hello all! Having recently started working with Java, coming from C++, I am now taking part in a Java project, the build of which is managed by Maven. I frequently run into a very basic situation exemplified by the two follwing classes, each of which is implemented in its own file: ---------------------------------------------------------------------- public interface Foo { void method1(); } public class FooImpl implements Foo { void method1() { ; } } ---------------------------------------------------------------------- After compiling, I make the follwing change, i.e., only change the interface: ---------------------------------------------------------------------- public interface Foo { void method1(); void method2(); } public class FooImpl implements Foo { void method1() { ; } } ---------------------------------------------------------------------- When building, I see only a recompilation of Foo.java, which indicates, that only a simple comparison of the respective timestamps of *.java and *.class files is undertaken. From my C++-work, based on gcc/make, I am accustomed to a setup, which in the analogous scenario for C++ detects the dependence of FooImpl on Foo and initiates a recompilation of FooImpl as well (in this example leading to a compile time error). Moreover, from the Java guys i frequently here something like "when in doubt, clean the project and rebuild". Although this is a matter of the build tools rather than the language, I would like to ask the experienced Java developers out here: is this to be put up with, or are there build mechanisms obviating this, concisely taking into account the interdependence of classes (like "gcc -M" in a make-based build system for C++). Greetings Markus