• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Is it right to handle all my projects open

 
Ricardo Coto
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm just wondering if it's recommended to have all my eclipse projects open, I mean, every time I open eclipse every project is going to update or build, I know i can disable that, but I don't wanna, I like that, but I came with this question, if i should just open the project I going to work, or it doesn't matter I have all the projects there, give me your thoughts....
 
Campbell Ritchie
Marshal
Posts: 64680
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you noticing any problems from having all your projects open simultaneously?
 
Ricardo Coto
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a lot of projects there, and my .m2 grows around 15gb, don't know if it's because of that...
 
Knute Snortum
Sheriff
Posts: 6033
157
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The directory .m2 is related to Maven.  Do you mean .p2?
 
Tim Holloway
Bartender
Posts: 20842
125
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only time I ever close projects in Eclipse is when I am definitely not going to be working with them any time soon and simply want to simplify the Project Explorer pane. I've never considered lots of open projects to be a drag on resources.

The .m2 directory, as Knute has said, isn't part of Eclipse. It's where your local Maven resource are. Specifically, your config files and your library jar caches. And that never shrinks unless you forcibly shrink it. Which requires manually deleting jar directories from the cache (I look for the oldest ones). Since the cache is the first place Maven looks when doing builds, if you're deleting a cached resource, Maven will simply re-download it.
 
Ricardo Coto
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure, i know .m2 belongs to maven, didn't say it but all the projects my company has are maven based, but you know when you open eclipse, it automatically update indexes, not pretty sure what that is, but I'm assuming is downloading sources and updating every project, so i think that's why my .m2 is so big, so i know is maven but is directly relate to eclipse because eclipse performed this maven stuff.

But yes I think is better to hand the projects you're working on instead of having like 30 projects that i have open there, another thing that annoyed me is, sometimes, and tell me if i'm wrong, eclipse gives stupid in existent errors, like right now, eclipse is giving me an error in one project saying 'unknown' in the first line of the pom, so, several projects with that kind of errors are displayed in the 'problems' tab, and is annoyed searching for the project errors you're currently working on
 
Tim Holloway
Bartender
Posts: 20842
125
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, maven is not directly related to Eclipse. Eclipse won't even know what to do with Maven if you don't have a Maven Eclipse plug-in installed.

And Eclipse does not update your local Maven cache, either at startup time or any other time. Only Maven updates your Maven cache, and even then only as needed to do a build. When it caches only the jars requested in the POM of the project being built.

Maven - when properly used - will never "update to the latest library version". One of the specific characteristics of Maven is that the POM should be asking for a specific version of dependency. That is to ensure that an exact duplicate of the output is createable at any time and any place. There can be one and only one proper copy of each dependency version. It is not proper protocol to use the same number on more than one build of a resource; if you do a new build, it should have a new version number. So unless you update your POM to request a different resource version number, once Maven has cached that resource, it will not update it.
 
Ricardo Coto
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure, ok you're taking a lot of assumptions like saying eclipse doesn't handle maven stuff, off course it does, yes you have to have the plugin installed, that is a logical statement that i expect you could extract, but it's ok, such as say if 'Maven - when properly used', i told you we have a lot of projects there developed through time, so off course not all of that projects are perfectly maven handled, that's a logical and obvious statement too...

But my question is answered thanks.
 
Tim Holloway
Bartender
Posts: 20842
125
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ricardo Coto wrote:Sure, ok you're taking a lot of assumptions like saying eclipse doesn't handle maven stuff,


I'm afraid I'm going to have to return that statement. Eclipse doesn't even "know" how to handle Java.

Eclipse, roughly speaking is an OSGi container with associated GUI. Everything else is plugins. Although the 2 most popular downloads for Eclipse are Eclipse with vanilla Java plugins and Eclipse with vanilla Java plugins plus JEE, Eclipse isn't even obliged to behave as an IDE at all. It has been promoted, in fact, to be an application framework in its own right, although I don't know of any cases where anyone has exploited that. Look on the detailed downloads page for Eclipse and you'll see that it's also available in versions that don't do Java at all.

I have installed and used plugins for Javascript development, Python development, C/C++ development, Unix shell script development, once even COBOL. I've installed plugins for version control systems, JNDI directory browsing, and more that I can't even recall. Even developed plugins myself.

Eclipse didn't "know" how to handle any of these plugins, much less how the different plugins interacted. That was all done in how the plugins installed themselves into Eclipse and how they were wired together. When a plugin wires itself into Eclipse's menus and toolbars, Eclipse knows how to display and dispatch them, but only insofar as the plugins have told it to. There are (at least) 2 different ways to wire Tomcat into Eclipse - one being the truly awful system used by the stock JEE Eclipse WTP plugin system, the other being the sysdeo-developed plugin that I personally prefer (it integrates more seamlessy with Tomcat).


So in brief, when you're assuming that Eclipse "knows" how to deal with Maven, you're got the cart and horse reversed. The Maven plugin knows how to connect Eclipse and Maven, and it's actually not native to either Eclipse or Maven itself, just made available from a third party.


Regardless, I've worked with all of the above (and at a low enough level) to be able to confidently assert that Eclipse isn't going to run rampant over your Maven cache every time it starts up. Or at any other time. Even Maven doesn't run rampant over the Maven cache.
 
Ricardo Coto
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So Tim, what do you think about intellij then ? i suppose you recomend it
 
Tim Holloway
Bartender
Posts: 20842
125
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IntelliJ - and NetBeans - are good products. JetBrains has been pretty ground-breaking in their R&D on domain-specific languages, and it's entirely possible (given Oracle's legal department) that someday Kotlin will become the preferred programming language for Android.

For Java, IntelliJ is very good for the average developer and I was delighted some years back when they added a WYSIWYG editor for Java GUI apps - the first useful one since the long-departed Borland Visual Café, and unlike the Borland product, it didn't require a proprietary library to support it (open-source projects don't like closed-source components).

However, Eclipse is my first choice. Not only because its extensive plug-in ecosystem supports just about any language and platform you might care to work on, but also because it is about the only IDE where I can debug a system where 2 Tomcat servers and an RMI server can cross-communicate under the direction of a remote client. And that's the kind of evil I delight in.
 
Ricardo Coto
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Tim, good stuff...
 
Jeanne Boyarsky
author & internet detective
Posts: 39343
755
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ricardo Coto wrote:I have a lot of projects there, and my .m2 grows around 15gb, don't know if it's because of that...


That's because the maven repo remembers everything you ever did. You can always delete it when you have time to repull the stuff you actually need on next build.

Note that there is an Eclipse setting "Do not automatically update dependencies from remote repositories". You want this checked to avoid a lot of work on startup. Especially if you have any snapshots.
 
Tim Holloway
Bartender
Posts: 20842
125
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah. i got in a lot of trouble once because Oracle's JDBC driver "cache" was, like Maven's, open-ended. Had a batch process that would run for 36 hours and "kaboom!". Spent a month tracking that down, because even though it was a documented feature, it wasn't a well-documented feature.  

I don't know about other people, but I kind of grew up with the notion that cache was self-limiting, like a FIFO or LIFO, or Least-Recently-Used. But open-ended caches never discard anything. Indeed, Maven doesn't even have a built-in mechanism for limiting its cache. Every so often when space gets tight, I just use a file-find utility to discover what cache files have been least recently used and brute-force delete them and their associated meta-files and containing directories. This is safe, since Maven will automatically re-fetch anything it actually needs.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!