Dependency resolution in Java builds

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
0
Markus
2/8/2011 10:26:22 PM
comp.lang.java.programmer 52266 articles. 40 followers. Post Follow

26 Replies
175 Views

Similar Articles

[PageSpeed] 3
On Feb 8, 2:26=A0pm, Markus Gessner <nos...@nospam.com> wrote:
> 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
> {
> =A0 void method1();
>
> }
>
> public class FooImpl implements Foo
> {
> =A0 void method1() { ; }}
>
> ----------------------------------------------------------------------
>
> After compiling, I make the follwing change, i.e., only change the
> interface:
>
> ----------------------------------------------------------------------
> public interface Foo
> {
> =A0 void method1();
> =A0 void method2();
>
> }
>
> public class FooImpl implements Foo
> {
> =A0 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++).

I've been looking for the same thing.

In short, all commonly available build systems suck. It's just a
difference of degree. That includes the idiomatic solution of
"Recursive Make Considered Harmful" with gnu make and gcc -M on c++
code. Ex: Try removing a cpp file, and see if your link output gets
rebuilt. See what happens when you add a new header file which hides
another header file on an include search path.

So, the modern commonly available Java build systems handle even less
of these dependencies than the common "Recursive Make Considered
Harmful" handles. I've been working on my actually incrementally
correct build system on the side which does /correct/ incremental
Java, but don't expect anything soon. (It also relies on Sun JVM's
compiler interface, which isn't Java standard but Sun standard, so
don't expect it to work on other platforms which don't have the Sun
JVM. However, the output bytecode is portable and can run
everywhere.)

I think you'll just have to make do with full clean builds. That's
also the advice I've heard from basically all Java people to whom I've
talked on this subject.

Builds is one of the most under-appreciated aspects of programming.
0
Joshua
2/9/2011 1:28:50 AM
On 08-02-2011 17:26, Markus Gessner wrote:
> 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++).

The clean and rebuild is the standard solution.

Arne
0
ISO
2/9/2011 2:03:03 AM
On 2/8/2011 2:26 PM, Markus Gessner wrote:

> 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.


I have it a quick test here, and it worked fine for me.  ant detected 
that the subclass file needed to be recompiled.  Javac told me the 
subclass did not implement the interface, and everything stopped there.

Maybe something with your build.xml file?  Perhaps if you showed us 
exactly what was happening, we could help you.

0
markspace
2/9/2011 2:10:12 AM
Joshua Maurice wrote:
> Builds is one of the most under-appreciated aspects of programming.

Second to deployment, which is subordinate to operations, which subsumes the 
aforementioned.

Generally, programmers as a class are woefully ignorant of 
build/deployment/ops matters.  I've seen this repeatedly in 
multi-million-dollar projects.  One such had radically different builds on 
developer machines from those on test/production machines.  You could pass all 
unit tests on the developer machine and fail on the test box, for example.

Another symptom is framework plethora.  Let's just throw our 
RichFaces/Acegi/Echo2/Spring/Spring-JDBC/Spring-Aspect/Spring-OMG!/ all over 
our XHTML over various disparate JMS scaffolds between localhost processes. 
No, that's not a rant, that's a prototypic description of more than one 
real-world scenario, both large and small projects.  The exact frameworks in 
question vary (I mentioned ones I've encountered in various combination) but 
the arity is similar.  I forbore to mention the classloader and library 
incompatibilities between JARS loaded by unchecked programmers and versions 
provided by the application server.

On a recent project I had the opportunity to get elbow-deep into Maven builds, 
Hudson continuous integration and deployments to a Java EE server.  Boy howdy!

On a less recent project, I worked for about six months with the ops guys, in 
a town I'll call Deploymentville. Their opinion of the project's programming 
team, about twenty miles up the highway in Programmerton?  "We like to get 
those Programmerton guys over here for about six months," one ops guru told 
me, grinning wickedly.  "They go back ... /changed/."

-- 
Lew
Ceci n'est pas une fenêtre.
..___________.
|###] | [###|
|##/  | *\##|
|#/ * |   \#|
|#----|----#|
||    |  * ||
|o *  |    o|
|_____|_____|
|===========|
0
Lew
2/9/2011 3:14:02 AM
Hello!

First of all, please excuse my typos of yesterday, it was a bit late
here in Europe.

On Tue, 8 Feb 2011 17:28:50 -0800 (PST), Joshua Maurice wrote:

> In short, all commonly available build systems suck. It's just a
> difference of degree. That includes the idiomatic solution of
> "Recursive Make Considered Harmful" with gnu make and gcc -M on c++
> code. Ex: Try removing a cpp file, and see if your link output gets
> rebuilt. See what happens when you add a new header file which hides
> another header file on an include search path.

This may happen, but in my everyday work I never came across such
situations. We even had a medley of metacompilers (moc, proc ...), and
the handling of the additional dependencies introduced by them also
always worked. You only had to explicitly add source files to some
*.pro-files, the makefiles were generated from, but that I happily
submitted to, everything else just working.

To sum it up -- this setup, devised a lot of years ago and never
changed, just worked, I almost never noticed it, which unobtrusiveness
IMHO is the best one can say about a tool. It was just "issue a command
and sit back".

> So, the modern commonly available Java build systems handle even less
> of these dependencies than the common "Recursive Make Considered
> Harmful" handles. I've been working on my actually incrementally
> correct build system on the side which does /correct/ incremental
> Java, but don't expect anything soon. (It also relies on Sun JVM's
> compiler interface, which isn't Java standard but Sun standard, so
> don't expect it to work on other platforms which don't have the Sun
> JVM. However, the output bytecode is portable and can run everywhere.)

This is a very laudable undertaking, but the fact of its necessity says
a lot about the common regard of this complex, as you note further
below.

> I think you'll just have to make do with full clean builds. That's
> also the advice I've heard from basically all Java people to whom I've
> talked on this subject.

At least now I won't do too much digging, although in this thread
markspace wrote about a different experience, which he made with Ant
(not Maven, I am stuck with, alas).

> Builds is one of the most under-appreciated aspects of programming.

Having just begun working with Java, I of course cannot really
appreciate its merits, but it seems, that it would be impossible to
implement the needs of a lot of business oriented applications without
its standards (Java EE), and some frameworks do have a certain charme
(e.g., JAXB and Hibernate). Nevertheless, the build environment I
experience gives me the overall impression of a car, nicely fitted with
teak panels, a GPS system and a minibar, but which has to be cranked
every mile or so. Says a somewhat frustrated mind, who prefers the
tramway :-)

Markus
0
Markus
2/9/2011 7:06:54 AM
Hello markspace!

On Tue, 08 Feb 2011 18:10:12 -0800, markspace wrote:

> I have it a quick test here, and it worked fine for me.  ant detected
> that the subclass file needed to be recompiled.  Javac told me the
> subclass did not implement the interface, and everything stopped
> there.

Thank you for your input and the work done for it! This sounds
encouraging, although it seems to contradict the experiences given by
the other posters.

> Maybe something with your build.xml file?  Perhaps if you showed us
> exactly what was happening, we could help you.

It is a host of pom.xml-files, so this would not be feasible, but I
greatly appreciate your kind offer!

My question was aimed at getting an overall appreciation of the
situation and the feasibility of looking for solutions.

Cheers
Markus
0
Markus
2/9/2011 7:18:19 AM
Markus Gessner wrote:
> Having just begun working with Java, I of course cannot really
> appreciate its merits, but it seems, that it would be impossible to
> implement the needs of a lot of business oriented applications without
> its standards (Java EE), and some frameworks do have a certain charme
> (e.g., JAXB and Hibernate). Nevertheless, the build environment I
> experience gives me the overall impression of a car, nicely fitted with
> teak panels, a GPS system and a minibar, but which has to be cranked
> every mile or so. Says a somewhat frustrated mind, who prefers the
> tramway :-)

OH, come on!  Really?

I've worked on some hairy large projects and smaller ones, too.  The time to 
build an application as affected by this issue is never a factor, unless you 
have improperly factored the dependencies, and that would be a problem in any 
language.

Java's dependencies, at least when using Ant (I agree Maven is a bitch), are 
usually resolvable for incremental builds without issue.  When they aren't, 
it's because of the unique features of Java (it compiles taking 
already-compiled libraries into account, sort of combining compilation and 
linking if you're thinking C[++]-ishly).  In those situations, you do a clean 
build and wait an extra minute.  Big effing deal!

If your clean builds take hours, that's not Java's fault, that's yours.

-- 
Lew
Ceci n'est pas une fenêtre.
..___________.
|###] | [###|
|##/  | *\##|
|#/ * |   \#|
|#----|----#|
||    |  * ||
|o *  |    o|
|_____|_____|
|===========|
0
Lew
2/9/2011 1:02:26 PM
Markus Gessner wrote:
> It is a host of pom.xml-files, so this would not be feasible, but I
> greatly appreciate your kind offer!

The highly-touted features of Maven, namely the auto-resolution of 
dependencies across the Internet, are confusing enough.  Add the pom.xml 
spaghetti perpetrated by the same numb-nuts who write spaghetti code and your 
situation gets pathetic indeed.

I'm on a project now with Maven builds that we inherited from such 
incompetents.  I've been part of an effort that's so far taken eight months to 
resolve the build issues.  It's a combination of bad project organization and 
Maven abuse (with a liberal dose of framework [Spring, et al.] abuse).  The 
trouble is you change something in one module (with its own pom.xml) and it 
breaks something in another related module.  And that one only had ten 
pom.xmls at its peak, down to seven thanks to our efforts.

Best of luck.

-- 
Lew
Ceci n'est pas une fenêtre.
..___________.
|###] | [###|
|##/  | *\##|
|#/ * |   \#|
|#----|----#|
||    |  * ||
|o *  |    o|
|_____|_____|
|===========|
0
Lew
2/9/2011 1:11:33 PM
On Feb 8, 11:18=A0pm, Markus Gessner <nos...@nospam.com> wrote:
> Hello markspace!
>
> On Tue, 08 Feb 2011 18:10:12 -0800, markspace wrote:
> > I have it a quick test here, and it worked fine for me. =A0ant detected
> > that the subclass file needed to be recompiled. =A0Javac told me the
> > subclass did not implement the interface, and everything stopped
> > there.
>
> Thank you for your input and the work done for it! This sounds
> encouraging, although it seems to contradict the experiences given by
> the other posters.

Ant's dependency analysis will handle a lot more cases than javac, but
it will still miss a large and important set of incremental changes.
Do not trust it.
0
Joshua
2/9/2011 10:52:35 PM
On Feb 8, 11:06=A0pm, Markus Gessner <nos...@nospam.com> wrote:
> Hello!
>
> First of all, please excuse my typos of yesterday, it was a bit late
> here in Europe.
>
> On Tue, 8 Feb 2011 17:28:50 -0800 (PST), Joshua Maurice wrote:
> > In short, all commonly available build systems suck. It's just a
> > difference of degree. That includes the idiomatic solution of
> > "Recursive Make Considered Harmful" with gnu make and gcc -M on c++
> > code. Ex: Try removing a cpp file, and see if your link output gets
> > rebuilt. See what happens when you add a new header file which hides
> > another header file on an include search path.
>
> This may happen, but in my everyday work I never came across such
> situations. We even had a medley of metacompilers (moc, proc ...), and
> the handling of the additional dependencies introduced by them also
> always worked. You only had to explicitly add source files to some
> *.pro-files, the makefiles were generated from, but that I happily
> submitted to, everything else just working.
>
> To sum it up -- this setup, devised a lot of years ago and never
> changed, just worked, I almost never noticed it, which unobtrusiveness
> IMHO is the best one can say about a tool. It was just "issue a command
> and sit back".

I think I'll stick with what I said - it's just a difference of
degree. Once in a blue moon, you could have a new header file which
hides another header file on an include search path, and an
incremental build will produce different results than a full clean
build. Also, as I said, (or perhaps meant to say?), the solution
advocated in "Recursive Make Considered Harmful" is still one of the
best solutions publicly available for C and C++.

Moreover, many of the ideas and concepts presented in that paper are
invaluable. It's what kicked off my quest to become a build expert.

I merely feel that the paper doesn't go far enough. I want a build
system so that, given the correctness of the build system executable,
it is impossible to make source code deltas /or build code/ deltas so
that the incremental build will produce different results than a full
clean rebuild. That, I think, is the critical difference between what
I want and all commonly available build systems. A pom.xml, a
makefile, an ant file, etc., are all executable code, written in an
interpreted domain specific language. I want a build language where
it's impossible to code the wrong thing. As this language is
restricted entirely to builds, I think that such a thing is quite
feasible and practicable. I'm working on it on and off in my spare
time.
0
Joshua
2/9/2011 10:59:48 PM
On Feb 9, 5:11=A0am, Lew <no...@lewscanon.com> wrote:
> Markus Gessner wrote:
> > It is a host of pom.xml-files, so this would not be feasible, but I
> > greatly appreciate your kind offer!
>
> The highly-touted features of Maven, namely the auto-resolution of
> dependencies across the Internet, are confusing enough. =A0Add the pom.xm=
l
> spaghetti perpetrated by the same numb-nuts who write spaghetti code and =
your
> situation gets pathetic indeed.
>
> I'm on a project now with Maven builds that we inherited from such
> incompetents. =A0I've been part of an effort that's so far taken eight mo=
nths to
> resolve the build issues. =A0It's a combination of bad project organizati=
on and
> Maven abuse (with a liberal dose of framework [Spring, et al.] abuse). =
=A0The
> trouble is you change something in one module (with its own pom.xml) and =
it
> breaks something in another related module. =A0And that one only had ten
> pom.xmls at its peak, down to seven thanks to our efforts.

I've been experiencing Maven hell for a couple years now. I think
we're over 1000 poms in a build which developers are expected to do
before each checkin. The automated build machine does that 1000 pom
build daily (or more) as well. Maven is the main driver of the build.
The build includes Java, C++, various in-house code generators, /and/
some Eclipse plugin build stuff which is cobbled together with some
rather poor scripts. Feel my pain.
0
Joshua
2/9/2011 11:03:16 PM
On Tue, 8 Feb 2011, Markus Gessner wrote:

> Moreover, from the Java guys i frequently here something like "when in 
> doubt, clean the project and rebuild".

A process which, for most people, is pretty fast - seconds to minutes. 
Much faster than in C, certainly. I suspect that the speed of clean builds 
has meant that there isn't much demand for incremental ones, and hence we 
don't have any ability to do them.

tom

-- 
.... but when you spin it it looks like a dancing foetus!
0
Tom
2/9/2011 11:26:23 PM
On Tue, 8 Feb 2011, Joshua Maurice wrote:

> Builds is one of the most under-appreciated aspects of programming.

I'll drink to that. Indeed, when working on build stuff, i often get the 
urge to do so before lunch.

tom

-- 
.... but when you spin it it looks like a dancing foetus!
0
Tom
2/9/2011 11:28:31 PM
Joshua Maurice wrote:
> I've been experiencing Maven hell for a couple years now. I think
> we're over 1000 poms in a build which developers are expected to do
> before each checkin. The automated build machine does that 1000 pom
> build daily (or more) as well. Maven is the main driver of the build.
> The build includes Java, C++, various in-house code generators, /and/
> some Eclipse plugin build stuff which is cobbled together with some
> rather poor scripts. Feel my pain.

That would be much easier if your project were organized into independent 
libraries with some smaller portion dependent thereupon.  I'm sure you know 
that, and it's likely impossible with such a large fubared code base, but 
others reading this might take a lesson.

-- 
Lew
Ceci n'est pas une fenêtre.
..___________.
|###] | [###|
|##/  | *\##|
|#/ * |   \#|
|#----|----#|
||    |  * ||
|o *  |    o|
|_____|_____|
|===========|
0
Lew
2/9/2011 11:43:46 PM
On Feb 9, 3:43=A0pm, Lew <no...@lewscanon.com> wrote:
> Joshua Maurice wrote:
> > I've been experiencing Maven hell for a couple years now. I think
> > we're over 1000 poms in a build which developers are expected to do
> > before each checkin. The automated build machine does that 1000 pom
> > build daily (or more) as well. Maven is the main driver of the build.
> > The build includes Java, C++, various in-house code generators, /and/
> > some Eclipse plugin build stuff which is cobbled together with some
> > rather poor scripts. Feel my pain.
>
> That would be much easier if your project were organized into independent
> libraries with some smaller portion dependent thereupon. =A0I'm sure you =
know
> that, and it's likely impossible with such a large fubared code base, but
> others reading this might take a lesson.

Correct on every count.

They're still going to try to un-fubar it by componentizing it. Guess
I'll see how that goes.
0
Joshua
2/9/2011 11:50:57 PM
On Tue, 8 Feb 2011, Lew wrote:

> Joshua Maurice wrote:
>> Builds is one of the most under-appreciated aspects of programming.
>
> Second to deployment, which is subordinate to operations, which subsumes 
> the aforementioned.
>
> Generally, programmers as a class are woefully ignorant of 
> build/deployment/ops matters.  I've seen this repeatedly in 
> multi-million-dollar projects.  One such had radically different builds 
> on developer machines from those on test/production machines.  You could 
> pass all unit tests on the developer machine and fail on the test box, 
> for example.

It's simply stunning that people let this happen in this day and age.

Even more stunning, we did it on our current project. There are some 
necessary differences between the dev and server builds (exploded vs 
packed EARs, for example), but the differences between the build processes 
for them are far greater than that difference requires. I didn't make the 
decision to make them so different; someone else did a long time ago. But 
that difference has persisted and grown on my watch, so there's blood on 
my hands.

Perhaps all that is required for bad builds to triumph is for good 
programmers to do nothing.

> Another symptom is framework plethora.  Let's just throw our 
> RichFaces/Acegi/Echo2/Spring/Spring-JDBC/Spring-Aspect/Spring-OMG!/ all 
> over our XHTML over various disparate JMS scaffolds between localhost 
> processes. No, that's not a rant, that's a prototypic description of 
> more than one real-world scenario, both large and small projects.  The 
> exact frameworks in question vary (I mentioned ones I've encountered in 
> various combination) but the arity is similar.

Isn't that just a question of shovelling JARs onto the classpath and then 
jarring up the right things? Or do these frameworks have more involved 
build requirements?

> I forbore to mention the classloader and library incompatibilities 
> between JARS loaded by unchecked programmers and versions provided by 
> the application server.

There is that.

> On a less recent project, I worked for about six months with the ops 
> guys, in a town I'll call Deploymentville. Their opinion of the 
> project's programming team, about twenty miles up the highway in 
> Programmerton?  "We like to get those Programmerton guys over here for 
> about six months," one ops guru told me, grinning wickedly.  "They go 
> back ... /changed/."

There is this very nebulous thing called The Devops Movement, which is not 
an antagonist from a James Bond novel, but some sort of theory that people 
with experience of operations should be involved in development:

http://en.wikipedia.org/wiki/DevOps

Seems lke a good idea.

tom

-- 
.... but when you spin it it looks like a dancing foetus!
0
Tom
2/9/2011 11:56:56 PM
On 09-02-2011 08:11, Lew wrote:
> Markus Gessner wrote:
>> It is a host of pom.xml-files, so this would not be feasible, but I
>> greatly appreciate your kind offer!
>
> The highly-touted features of Maven, namely the auto-resolution of
> dependencies across the Internet, are confusing enough.

You can set it up to use your own repository.

>                                                        Add the pom.xml
> spaghetti perpetrated by the same numb-nuts who write spaghetti code and
> your situation gets pathetic indeed.
>
> I'm on a project now with Maven builds that we inherited from such
> incompetents.

It is my impression that Maven is a 90% tool. It make life easier for
the 90% easiest cases - cases where it is possible to have
the project follow the Maven philosophy. For the remaining
10% the same features that make it easier for the normal cases
make it real hard. So if the project is tricky, then you
are probably better of with Ant that is intended as
a custom build script tool.

Arne
0
UTF
2/10/2011 12:39:33 AM

"Tom Anderson" <twic@urchin.earth.li> wrote in message 
news:alpine.DEB.1.10.1102092321530.18846@urchin.earth.li...
> On Tue, 8 Feb 2011, Markus Gessner wrote:
>
>> Moreover, from the Java guys i frequently here something like "when in 
>> doubt, clean the project and rebuild".
>
> A process which, for most people, is pretty fast - seconds to minutes. 
> Much faster than in C, certainly. I suspect that the speed of clean builds 
> has meant that there isn't much demand for incremental ones, and hence we 
> don't have any ability to do them.

I'd guess you're right. 

0
Mike
2/10/2011 4:51:47 AM
Lew wrote:
>> Another symptom is framework plethora. Let's just throw our
>> RichFaces/Acegi/Echo2/Spring/Spring-JDBC/Spring-Aspect/Spring-OMG!/ all over
>> our XHTML over various disparate JMS scaffolds between localhost processes.
>> No, that's not a rant, that's a prototypic description of more than one
>> real-world scenario, both large and small projects. The exact frameworks in
>> question vary (I mentioned ones I've encountered in various combination) but
>> the arity is similar.

Tom Anderson wrote:
> Isn't that just a question of shovelling JARs onto the classpath and then
> jarring up the right things? Or do these frameworks have more involved build
> requirements?

I wish it was that easy.  There are at least two orders of problem.  The first 
is that the frameworks often pull in different versions of the same libraries. 
  The other is that the frameworks interact with each other in, ahem, emergent 
and unexpected ways.  On top of those, sometimes different frameworks have 
overlapping functionality, such as Spring/JDBC and Hibernate, making it 
difficult to implement a coherent strategy for such functionality.

On a recent project with Maven builds, we had a parent build ("foomain") and 
several subsidiary modules ("foofrontend", "foologic", "foopersistence", ...). 
  Historically different versions of the same frameworks were specified for 
the different modules.  Yet when you pulled the dependencies into the 
"foomain" pom.xml in common the build broke.  Turns out some of the 
dependencies transitively depend on the same libraries, but different versions 
also, some of which are transitive dependencies for other stuff, also 
different versions.

I tried "shoveling JARs".  Nope.  It's subtler than that.

-- 
Lew
Ceci n'est pas une fenêtre.
..___________.
|###] | [###|
|##/  | *\##|
|#/ * |   \#|
|#----|----#|
||    |  * ||
|o *  |    o|
|_____|_____|
|===========|
0
Lew
2/10/2011 1:09:05 PM
Lew wrote:
>> The highly-touted features of Maven, namely the auto-resolution of
>> dependencies across the Internet, are confusing enough.

Arne Vajhøj wrote:
> You can set it up to use your own repository.

Of course, then it still reaches across the 'net every time something asks for 
a more (or less) version that's not in the local repository.  Without asking, 
and barely telling.

You don't think we tried that?  Thanks for the awesome advice, though!

Lew wrote:
>> Add the pom.xml
>> spaghetti perpetrated by the same numb-nuts who write spaghetti code and
>> your situation gets pathetic indeed.
>>
>> I'm on a project now with Maven builds that we inherited from such
>> incompetents.

Arne Vajhøj wrote:
> It is my impression that Maven is a 90% tool. It make life easier for
> the 90% easiest cases - cases where it is possible to have
> the project follow the Maven philosophy. For the remaining
> 10% the same features that make it easier for the normal cases
> make it real hard. So if the project is tricky, then you
> are probably better of with Ant that is intended as
> a custom build script tool.

Since real-world projects are nearly never simple, I challenge your "90%" 
claim.  I'd be surprised if the number were 10%.  Do you have any evidence for 
that statistic?

The project I'm on isn't even especially complicated, except for the Maven 
builds.  I wish it were based on Ant, but converting back once it's tangled up 
in Maven is not straightforward.  None of us, not even my management (!), is 
happy with Maven.

-- 
Lew
Ceci n'est pas une fenêtre.
..___________.
|###] | [###|
|##/  | *\##|
|#/ * |   \#|
|#----|----#|
||    |  * ||
|o *  |    o|
|_____|_____|
|===========|
0
Lew
2/10/2011 1:16:36 PM
On Thu, 10 Feb 2011 08:09:23 -0500, Lew wrote:

> Lew wrote:
> 
> On a recent project with Maven builds, we had a parent build ("foomain")
> and several subsidiary modules ("foofrontend", "foologic",
> "foopersistence", ...).
>   Historically different versions of the same frameworks were specified
>   for
> the different modules.  Yet when you pulled the dependencies into the
> "foomain" pom.xml in common the build broke.  Turns out some of the
> dependencies transitively depend on the same libraries, but different
> versions also, some of which are transitive dependencies for other
> stuff, also different versions.
> 

So it wasn't really Maven problem but dependency management problem.
From my experience Maven just makes dependency management issues explicit 
and visible. I would argue it is a good thing.

-- 
Michal
0
Michal
2/10/2011 2:17:28 PM
Tom Anderson <twic@urchin.earth.li> writes:

> On Tue, 8 Feb 2011, Markus Gessner wrote:
>
>> Moreover, from the Java guys i frequently here something like "when
>> in doubt, clean the project and rebuild".
>
> A process which, for most people, is pretty fast - seconds to
> minutes. Much faster than in C, certainly. I suspect that the speed of
> clean builds has meant that there isn't much demand for incremental
> ones, and hence we don't have any ability to do them.

On the project I work on, every build is followed by a set of automated
tests (first unit, then integration).  Compiling takes a few minutes,
and running the tests normally takes about an hour.  So we do a clean
build every time.

When I'm working at my desk, I just save and Eclipse handles the rest,
usually in less than a second.

-- 
Jim Janney
0
Jim
2/10/2011 9:59:24 PM
Lew wrote:
>> On a recent project with Maven builds, we had a parent build ("foomain")
>> and several subsidiary modules ("foofrontend", "foologic",
>> "foopersistence", ...).
>>    Historically different versions of the same frameworks were specified
>>    for
>> the different modules.  Yet when you pulled the dependencies into the
>> "foomain" pom.xml in common the build broke.  Turns out some of the
>> dependencies transitively depend on the same libraries, but different
>> versions also, some of which are transitive dependencies for other
>> stuff, also different versions.

Michal Kleczek wrote:
> So it wasn't really Maven problem but dependency management problem.
>  From my experience Maven just makes dependency management issues explicit
> and visible. I would argue it is a good thing.

My experience is that Maven quietly ignores your desire to keep things in the 
local repository and messes up your dependencies.  I would argue that 
invisibly making changes is NOT a good thing.

Part of the problem I described is due to Maven's quiet retrieval of different 
transitive dependencies.  If it had instead crashed the build with a message 
about an unresolved dependency, it would have been better.  That certainly was 
not a good thing, and it's laid right at Maven's feet.

Sometimes even a bad tool can be used effectively, if a person is aware of all 
the kinks and quirks and is willing to take the effort to work around them. 
Such tool's effectiveness under those conditions is not evidence of its goodness.

Maven sucks.

-- 
Lew
Ceci n'est pas une fenêtre.
..___________.
|###] | [###|
|##/  | *\##|
|#/ * |   \#|
|#----|----#|
||    |  * ||
|o *  |    o|
|_____|_____|
|===========|
0
Lew
2/11/2011 12:07:41 AM
On Feb 10, 4:08=A0pm, Lew <no...@lewscanon.com> wrote:
> Lew wrote:
> >> On a recent project with Maven builds, we had a parent build ("foomain=
")
> >> and several subsidiary modules ("foofrontend", "foologic",
> >> "foopersistence", ...).
> >> =A0 =A0Historically different versions of the same frameworks were spe=
cified
> >> =A0 =A0for
> >> the different modules. =A0Yet when you pulled the dependencies into th=
e
> >> "foomain" pom.xml in common the build broke. =A0Turns out some of the
> >> dependencies transitively depend on the same libraries, but different
> >> versions also, some of which are transitive dependencies for other
> >> stuff, also different versions.
> Michal Kleczek wrote:
> > So it wasn't really Maven problem but dependency management problem.
> > =A0From my experience Maven just makes dependency management issues exp=
licit
> > and visible. I would argue it is a good thing.
>
> My experience is that Maven quietly ignores your desire to keep things in=
 the
> local repository and messes up your dependencies. =A0I would argue that
> invisibly making changes is NOT a good thing.
>
> Part of the problem I described is due to Maven's quiet retrieval of diff=
erent
> transitive dependencies. =A0If it had instead crashed the build with a me=
ssage
> about an unresolved dependency, it would have been better. =A0That certai=
nly was
> not a good thing, and it's laid right at Maven's feet.
>
> Sometimes even a bad tool can be used effectively, if a person is aware o=
f all
> the kinks and quirks and is willing to take the effort to work around the=
m.
> Such tool's effectiveness under those conditions is not evidence of its g=
oodness.
>
> Maven sucks.

I've one of the resident build experts in my company for my product
team. I wrote half the stuff in use, including some home grown C++
Maven plugins which are working decently well when compared to the
Maven standard plugins.

One of my first pieces of advice is to do a full online (re)build up
front, then never ever do an online build ever again until your next
full clean rebuild. I've seen so many build failures that happened due
to Maven's curious and silent downloads of artifacts because the
developer accidentally forgot to specify the "-o" flag one time. I
tell them to use canned scripts where each script has "-o" hardcoded
in, but some don't listen.

Maven is a tolerable dependency management system, that is getting
various things online, automatically downloading them, version
mismatch resolution for different transitive dependencies, etc.,
especially for the toy example. However, it is a miserable failure
when it comes to a the /build/ part of a build system.
0
Joshua
2/11/2011 12:37:46 AM
On 10-02-2011 08:16, Lew wrote:
> Arne Vajhøj wrote:
>> It is my impression that Maven is a 90% tool. It make life easier for
>> the 90% easiest cases - cases where it is possible to have
>> the project follow the Maven philosophy. For the remaining
>> 10% the same features that make it easier for the normal cases
>> make it real hard. So if the project is tricky, then you
>> are probably better of with Ant that is intended as
>> a custom build script tool.
>
> Since real-world projects are nearly never simple, I challenge your
> "90%" claim. I'd be surprised if the number were 10%. Do you have any
> evidence for that statistic?

The 90-10 were not statistical information but magnitude indication.
Like in 10% of the code use 90% of the time, 90% of the project takes
90% of the time and the 10% also takes 90% of the time.

Maven is pretty widely used.

And I know of several projects that are happy using it.

Real world projects can be relative simple in build. I would even
say that they should be relative simple in build. Complex builds
are usually a symptom of a bigger problem in the app.

Of course projects with problems, complex builds and Maven not
working properly is still common.

> The project I'm on isn't even especially complicated, except for the
> Maven builds. I wish it were based on Ant, but converting back once it's
> tangled up in Maven is not straightforward. None of us, not even my
> management (!), is happy with Maven.

Personally I prefer ant over Maven - I like the ability to code
my build. But from a project perspective coding the build
is just extra cost.

Arne

0
UTF
2/11/2011 3:02:24 AM
Arne Vajhøj wrote:
> The 90-10 were not statistical information but magnitude indication.
> Like in 10% of the code use 90% of the time, 90% of the project takes
> 90% of the time and the 10% also takes 90% of the time.
>
> Maven is pretty widely used.
>
> And I know of several projects that are happy using it.
>
> Real world projects can be relative simple in build. I would even
> say that they should be relative simple in build. Complex builds
> are usually a symptom of a bigger problem in the app.
>
> Of course projects with problems, complex builds and Maven not
> working properly is still common.
>
>> The project I'm on isn't even especially complicated, except for the
>> Maven builds. I wish it were based on Ant, but converting back once it's
>> tangled up in Maven is not straightforward. None of us, not even my
>> management (!), is happy with Maven.
>
> Personally I prefer ant over Maven - I like the ability to code
> my build. But from a project perspective coding the build
> is just extra cost.

I'll take a fresh look.

-- 
Lew
Ceci n'est pas une fenêtre.
..___________.
|###] | [###|
|##/  | *\##|
|#/ * |   \#|
|#----|----#|
||    |  * ||
|o *  |    o|
|_____|_____|
|===========|
0
Lew
2/11/2011 4:33:11 AM
Reply:
Similar Artilces:

[tao-users] ace build ignores qos #2
This is a multi-part message in MIME format. --------------010302010107000105050804 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit CIAO VERSION: 0.4.6 TAO VERSION : 1.4.6 ACE VERSION : 5.4.6 HOST MACHINE and OPERATING SYSTEM: Win XP Professional, Winsock 3.10.0.103 CrossCompilation for Linux-Target THE $ACE_ROOT/ace/config.h FILE: #include "config-linux.h" CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features (used by MPC when you generate your own make...

[Announce] Dependable
This is the announcement of a release of the 'dependable' dependency solver. Dependable is a minimal-dependency perl script which finds and installs the libraries necessary to install a particular piece of software. It can be called by various configure/install scripts and retrieve libraries from mounted directories, HTTP servers or FTP servers. The package distributor finds and lists the libraries required for his/her package along with relevant SHA1 or MD5 hashes. A dependable.running file with this information is distributed along with the dependable.pl executable. ...

java client like keytool
Hi, Does any of you guys know of a free Java tool/library which allows a Java client to obtain functionality similar to that of keytool (creating keystore files, exporting to a cer file ...).. (This tool should be used by my java client and not a command line tool) TIA. ...

Jove: The Open Verification Environment for Java
Newisys <http://www.newisys.com/> is pleased to announce the release of Jove: The Open Verification Environment for the Java (TM) Platform. Jove is a set of Java APIs and tools to enable Verilog hardware design verification of ASICs and FPGAs using the Java programming language. It contains components that accomplish the following: � �* Verilog simulator interaction (via PLI 2.0 aka VPI) � �* Standalone behavioral simulation (i.e. a discrete event simulator) � �* Thread and event synchronization � �* Design Verification abstractions (e.g. clock-relative signal access, mailboxe...

[ANN] DataSift 1.0b1
DataSift 1.0b1, the first usable version of AuelProject DataSift, has just released. DataSift is a powerful java data validation and transformation framework, aimed at enterprise software development, which provides developers with an extensible architecture they can fully adapt to their software needs. Almost every feature in it can be configured in some way, and developers can create new plugins that extends its capabilities. For more information, see: http://www.datasift.org You can find the latest release here: https://sourceforge.net/project/showfiles.php?gro...

Identifying C++ Component Dependencies
Hi. I've got a question about "component" dependencies in C++. For this discussion, I'm considering a component to be a group of classes that implement a service provided to other components via an interface or via a service request message. Consider component A and B. B offers a service processWidget. This service is invoked by A sending a ProcessWidget message to B. The message is represented by the header file ProcessWidgetMsg.h. My directory structure is set up so each component has a root directory named after the component. So in this example, we have peer direc...

Java Memory Module
Greetings: I am looking for a good Whitepaper or documentation pertaining to Java's Memory Module. Any help is kindly apreciate Wyndell wrote: > I am looking for a good Whitepaper or documentation pertaining to > Java's Memory Module. "Memory module" is not a commonly used term for anything relating to Java. However, if you define exactly what you mean by "memory module" in this context, perhaps we can still help. -- www.designacourse.com The Easiest Way to Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corpo...

US-TX-Austin: Websphere Developer, IBM Websphere, Sun Java, 1mo. (45392333045)
US-TX-Austin: Websphere Developer, IBM Websphere, Sun Java, 1mo. (45392333045) ============================================================================== Position: Websphere Developer Reference: ALM00039 Location: Austin TX Duration: 1mo. Skills: Application development experience involving enterprise-level IT solutions. Web-based application development for both Inter- and Intranet environments. Knowledge of IBM WebSphere, and Sun Java. J2EE Development JDK - (Servlets, JSP, JSF, EJB, JDBC, JMS) a...

how to make a protobuf dependent lib avaliable in a non-protobuf enviroment?
I have a C++ project depending on protobuf, but there's no guarantee that a= ll users have protobuf installed on there own PC(protobuf is only not the o= nly way of serialization) but they also want to use the project as a lib. I= n that case, dynamic linking to protobuf while compiling the project is not= a choise(the project.so will dynamicly depending on libprotobuf.so) what c= an I do? On Thursday, 11 July 2013 10:32:52 UTC+3, Minxuan Zhuang wrote: > I have a C++ project depending on protobuf, but there's no guarantee that > all users have protobuf installed on th...

Kobweb Java
Kobweb Java is an independent board that is online based, founded by advanced Java programmers who have implemented this board to engage in world wide Java programming. Kobweb Java is a private online community that is used to help beginner programmers with a problem solving approach using the Java programming language. The program is designed in a way that makes it flexible for members to use the course at any time, giving members the freedom to withdraw or re-continue with what they have learned by themselves as Kobweb Java is strictly a self study online programming based course....

SN#11850 Sun Certification Packages for Java[TM] Technology
SYSTEM NEWS FOR SUN USERS Vol 70 Issue 5 2003-12-29 Article 11850 from section "Java Technology" Five-Day Accelerated Training Courses with Certified Experts Comprehensive certification packages developed by Sun are economic solutions to becoming a Java[TM] technology programmer, developer, Web component developer or architect. These five-day sessions target C++ programmers moving to Java technology as well as seasoned Java technology aficionados wanting to advance their knowledge and career potential. Certi...

Help: which is the best book in java ?
Hi all,which is the best book to learn java . I already have 2 plus of exp asdeveloper , DBA in oracle Applications - but need to switch to javanow . Please guide me in knowing which is the best book to learnjava .thanks in advance,senthil senthil wrote: .. >which is the best book to learn java . Is that a question? Note how the inclusion of '?' marks my words as a question. >..I already have 2 plus of exp as >developer , DBA in oracle Applications - but need to switch to java >now . Please guide me in knowing which is the best book to learn >java . I find these...

Problems with dependencies....
I use a Mandrake 8.2 system w/ 2.4-kernel and have just replaced a home-written iptables ruleset with gShield (which works perfect), a neat feature I hadven't used before (with my own ruleset) was the possibility to forward terminal services request to my W2k server, but this apparently required iptables 1.2.7 and I use 1.2.5, so I downloaded the 1.2.7 rpm and gave it a shot (rpm -i -v ...) which told me "libc.so.6(GLIBC_2.3) needed by iptables 1.2.7 and so on - I downloaded the glibc 2.3.3 and was told that *that* one required a new initscripts and after downloading the initscripts r...

[ace-users] Ubuntu 12.10 ACE+TAO v6.1.7 Build errors
So to try and get past this error, I ran the realclean make macro, and trie= d to make the source tree a second time. No joy. Since this error is an ACE= app complaining about not being able to link to its own, just created libr= ary binary, I assume this is a build architecture issue. The g++ "-L" optio= n seems to be pointing to the right place, however, the linker isn't recogn= izing it. ACE VERSION: 6.1.7 HOST MACHINE and OPERATING SYSTEM: Ubuntu 12.10 32bit OS on Intel TARGET MACHINE and OPERATING SYSTEM, if different from HOST: Same COMP...

Confusion about Thinkpad T23 display resolution
I can't figure this one out: For the Thinkpad T23 I get conflicting information about the native resolution of the integrated display. Half of the references claim it is 1024x768, the other half say it is 1400x1050. IBM seems to have taken down their T23 page :-/ What is the actual resolution? Thanks Martin -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Martin Cracauer <cracauer@wavehh.hanse.de> http://www.cons.org/cracauer/ FreeBSD - where you want to go. Today. http://www.freebsd.org/ If I recall correctly, there were at least two different ...

Passing a java object to a CGI/PERL script
I am new at web page design and was wondering if I created an object in JavaScript or an array can I pass it back to a perl script for processing. One example my be where a customer has the ability to select multiple items from a single page. By using checkboxes the end user selects multiple item and enters quantities for those item. By passing some sort of data structure (array or object) back the script for processing. I know I can build an object in JavaScript populating it with pertinent information. Let me know what you think? Thanks Jim Rendant -- PLEASE NOTE: c...

Problem Running Application (Java + Excel Doc)
I have to be honest. This is my first attempt at writing an application and I have run in to a large road block. I am trying to read an MS Excel 2000 Document with Java (Using the Java Excel API @ http://www.andykhan.com/jexcelapi/). I have been writing this program in the NetBeans IDE 4.0 which had been working well for me, i get some warnings but nothing too bad. When I compile and run the progran with NetBean it works, but when i try to run it in dos using java -jar it give me: Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: jxl/read/biff/BiffException ...

Help! ActiveState Tcl 8.5 on Windows 7 - TclOO 6.2 load
Hello, Restarting Tcl after a long time :-) Recently I downloaded ActiveState Tcl to get going faster. So the environment is: Wish/ActiveState/ Windows 7. I was trying to go through latest changes in 8.5 - and TclOO was on the forefront. ActiveState's archive suggests (in 2008) to run depends.exe for TclOO062.dll - did that. It gave an error: "No PE signature found. This file appears to be a 16- bit DOS module." Upon searching further, this appears to be an FAQ almost. How can I get to load TclOO - and start tcling again? Any other packages known to be broken in this distribut...

swapping java SDK versions. right way?
there's a java that lives in /usr/bin. on my machine, that's version 1.2.2, i think--whatever, they want it updated. is it a good idea to remove the current java packages first? is there a comprehensive way to find out which packages those are, beforehand? assuming i just drop the new one in, will old programs work with the new java SDK? my C programs always survive whatever random upgrade i throw at them, but this is java, and i don't know java. i've downloaded the 32, 64 bit versions of 1.4.2 JDK, in both package and shell archive (i guess) form. presumably, the 64 bit...

IWA and Java
Hi All, I'm sure this question must have been asked before but after searching Google and newsgroups I cant seem to find any useful resources. I am looking for some way to integrate java with Integrated Windows Authentication (IWA). I will describe my scenario below and hopefully someone can point me in the right direction. Basically I have java program which has lots of screens etc. I am wanting to assign individual access rights to each screen (full, edit, view, none) for each user using an access table I already have designed. The software will be running on a ...

compiling ordering of java sorce code
HI I s there a program that for a given directory sorts the correct order of compiling, ie if file a.java depends on file b.java then file b.java is compiled first or added the file list at command line? thanks in advance Neil Morris -- my IE6 favorites for import into Netscape/Internet Explorer www.neilmorris.btinternet.co.uk/bookmark.htm http://www.neilmorris.btinternet.co.uk/ Neil Morris wrote: > HI > I s there a program that for a given directory sorts the correct order of > compiling, ie if file a.java depends on file b.java then file b.java is > compiled first or added t...

Best Build Tool for large C projects #2
What is the best build tool for somebody who want to get rid of make. I'm looking for something with the following features: 1) Must scan the files for dependencies. 2) Results from 1 must be safed so that not each invokation is doing a complete scan because the files may be on a NFS with slow connections. 3) Should do a preprocessing run and check if there are real changes. If i change code 4) Collects compile optinos in a database/central location so i don't need to set them in a lot of build files. 5) Works well with multiple CPU's/Core's and ideally detects the number ...

Java Game- Game can't find it's graphics jar file
My name is Nick Soutter, I own a small game development company (www.aepoxgames.net) making our first game (www.andromedaonline.net) in java. I am writing because we are having a very serious problem, and I was hoping someone might have thoughts. Our game has 2 main programs- one is an updater, the other is the game client. The updater (AndromedaOnline.jar) checks for updates to the graphics, sound, client, and of course itself. After applying any updates, the updater runs the client (AndromedaClient.jar) for people to play with. When players install this program on their systems with...

java network programming book
this book is useful for who is looking for network programming http://www.dct.udn.vn/daotao/Resource/82487.pdf if there an option to upload this book in this group website i'll do it On Wed, 17 Jun 2009 15:24:11 -0700 (PDT), moh_harbi6 <moh_harbi6@hotmail.com> wrote, quoted or indirectly quoted someone who said : >if there an option to upload this book in this group website i'll do >it newsgroups are for short posts. To post something long, post an URL, as you have done. -- Roedy Green Canadian Mind Products http://mindprod.com If everyone lived the way peo...

Functon dependencies
Hello all, Merry Xmas... I have a directory of m files, is there a way to be able to see the dependencies of the files for exemple if A.m calls B.m then B calls C.m etc... Thanks if you can help "stat " <statquant@gmail.com> wrote in message <hhct7a$2t6$1@fred.mathworks.com>... > Hello all, > Merry Xmas... > I have a directory of m files, is there a way to be able to see the dependencies of the files for exemple if A.m calls B.m then B calls C.m etc... > > Thanks if you can help a hint: help depfun; % and if you want a very fast wrap...