File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes maven and eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "maven and eclipse" Watch "maven and eclipse" New topic
Author

maven and eclipse

Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

at work we do a lot of generated code, and suffer lots of recursive build hell, where eclipse decides everything needs rebuilding immediatly after the last build in a continual loop.

Everything I have read says that eclipse and maven are not happy bedfellows, so am considering giving up.

my question is this... is there a dowside to this?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16055
    
  21

If you've got sufficient complexity in your build environment to get into situations like that, the last thing I'd be considering would be to move from a disciplined build environment like Maven to an ad-hoc one. Especially just to make an IDE happy. One of the reasons I'm so big on UI-free build processes like Ant and Maven is that GUI-based builders come and go, but the text-based stuff is more stable. And stability is critical in a large business environment.

I'd consider turning off the Eclipse auto-build instead. Which I've done on occasion when Eclipse got its wires excessively crossed.

However, since recent versions of Eclipse have been better behaved in that area (just don't ask me my opinions about its XML/HTML editors ), if I were you, I'd map out the Maven inter-dependencies and ensure that they weren't truly circular. Because if they are, you can't reliably build everything from scratch on a cold machine. And that's the kind of stuff that makes me nervous.


Customer surveys are for companies who didn't pay proper attention to begin with.
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

oh no they aren't really circular, somedays it just works. There are people here much cleverer than me trying to get the eclipse m2e pulgins working properly, but somedays they just don't.

My intention was just to get a clean eclipse without maven, and use the command line for all the maven stuff, then refresh eclipse when i need to. I know it isn't ideal but i think i got about 15 -2 days actual work done last week (i work full time).
and because of the build problems we are trying to only have the fewest projects open at once, and all the thrashing is adding to the problems, making jboss unhappy (projects go missing from the deployment assembly).
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16055
    
  21

I doubt the problem is with eclipse2me, which is mostly driving background batch. The problem is typically when Eclipse tries to sync up with the out-of-band changes. That's assuming that you don't have Eclipse set up to run Maven automatically on changes. I don't. Because even without circularity the overhead would be unspeakable.

As a completely tangential observation, one thing I've noticed is that the places in a project that "should" be consuming the most time (the "hard" parts) are often much, much easier than expected. But the savings get totally eaten up by fights with the tools, miscapitalized/mispunctuated code that takes 3 days and 4 people to detect, etc.
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107


That's assuming that you don't have Eclipse set up to run Maven automatically on changes.


oh yes we do, so when we change one of the xml definition files it goes off and magically generates all the changed files, then compiles everything else that might be affected by that change.

see the scope for horribleness.
How do we turn this off?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16055
    
  21

I never figured out how to turn it on, myself. I didn't want to.

Out of the box, Maven will run itself (after a fashion) when you change dependencies in the POM, but that doesn't do much; to get them to "take", I actually run Maven from a command prompt.

To actually make maven select and run a goal(s) on source changes, requires that someone set up some additional build characteristics in the Eclipse workspace, as far as I know.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

Try unchecking the 'Build Automatically' setting at Window > Preferences > General > Workspace, that should prevent the build cycle from starting up after every save.

JBoss In Action
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16055
    
  21

Peter Johnson wrote:Try unchecking the 'Build Automatically' setting at Window > Preferences > General > Workspace, that should prevent the build cycle from starting up after every save.


There's more to it than that, though. I have automatic build enabled, but that doesn't run Maven. Methinks someone has added some extra builders to the standard set.
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

oh yes, the idea is that we all build exactly the same way, the developers in eclipse, thejenkins build, the kitting build etc. So I don't think there is a single shred of original eclipse build left.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: maven and eclipse