Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #25653
| From | Markus Gessner <nospam@nospam.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Dependency resolution in Java builds |
| Date | 2011-02-08 23:26 +0100 |
| Message-ID | <87oc6mi2nl.fsf@web.de> (permalink) |
| Organization | Arcor |
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
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar
Dependency resolution in Java builds Markus Gessner <nospam@nospam.com> - 2011-02-08 23:26 +0100
Re: Dependency resolution in Java builds Joshua Maurice <joshuamaurice@gmail.com> - 2011-02-09 14:52 -0800
Re: Dependency resolution in Java builds Arne Vajhøj <arne@vajhoej.dk> - 2011-02-09 19:39 -0500
Re: Dependency resolution in Java builds Jim Janney <jjanney@shell.xmission.com> - 2011-02-10 14:59 -0700
Re: Dependency resolution in Java builds Markus Gessner <nospam@nospam.com> - 2011-02-09 08:18 +0100
Re: Dependency resolution in Java builds Lew <noone@lewscanon.com> - 2011-02-09 18:43 -0500
Re: Dependency resolution in Java builds Joshua Maurice <joshuamaurice@gmail.com> - 2011-02-09 15:50 -0800
Re: Dependency resolution in Java builds Lew <noone@lewscanon.com> - 2011-02-09 08:11 -0500
Re: Dependency resolution in Java builds Joshua Maurice <joshuamaurice@gmail.com> - 2011-02-09 15:03 -0800
Re: Dependency resolution in Java builds "Mike Schilling" <mscottschilling@hotmail.com> - 2011-02-09 20:51 -0800
Re: Dependency resolution in Java builds Arne Vajhøj <arne@vajhoej.dk> - 2011-02-08 21:03 -0500
csiph-web