• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Yet Another Broad Maven Question

 
Ranch Hand
Posts: 189
14
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I've been using Maven via the Eclipse IDE for a number of months.  While I'm familiar with some aspects of what Maven does - the structure of a POM, why one would use Maven - I'm still a little unclear on what the technology does or how it works and I'm hoping someone here can clear a few things up.

My first question is when I include a dependency in the POM - say, version 4.3.0 of the Spring Framework - what actually happens?  My guess is that something in Eclipse's Maven goes to the Maven Central Repository, downloads the JARs for Spring and places them in the m2 Repository on my local machine.  Is that correct?

My second question is quite specific to my working conditions and will require a bit of background, so bear with me.  :-)

The company that I work for has a pretty restrictive internet security policy and I think that they must have placed some firewall restriction on the Maven Central Repository.  The reason I think this is because when I included a dependency for Spring in my POM on an Eclipse Maven Project none of the classes I was writing initially recognised any of the Spring classes.  Through a lot of investigation I found a solution whereby I had to

  • Update my local Maven install's config file to use my company's proxy server
  •  
  • Manually download the JARs for Spring and store them in a location on my local machine
  • In a Maven Build run configuration on my project run the following command for each JAR I want to include:  install:install-file -Dfile=<path-to-file> -DgroupId=<group-id>  -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>


  • My question is if Maven is supposed to make things easier for the user by just downloading these JARs to the local repository automatically then is there an alternative to the labour-intensive solution I just described?  Did I make things harder for myself or was there an easier way to go about it?
     
    author & internet detective
    Posts: 40181
    812
    Eclipse IDE VI Editor Java
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Simon Ritchie wrote:My first question is when I include a dependency in the POM - say, version 4.3.0 of the Spring Framework - what actually happens?  My guess is that something in Eclipse's Maven goes to the Maven Central Repository, downloads the JARs for Spring and places them in the m2 Repository on my local machine.  Is that correct?


    Conceptually, yes. Maven goes to your local repo and doesn't see it. Then it gets it from Maven Central. It also looks for any dependencies and gets you those too.

    Simon Ritchie wrote:My question is if Maven is supposed to make things easier for the user by just downloading these JARs to the local repository automatically then is there an alternative to the labour-intensive solution I just described?  Did I make things harder for myself or was there an easier way to go about it?


    Yes. Using a local repository manager like Nexus. This saves bandwidth, avoids the firewall issues and gives you and your teammates a shared space. It also gives you someplace to publish your own stuff too.
     
    Simon Ritchie
    Ranch Hand
    Posts: 189
    14
    Hibernate Eclipse IDE Spring
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks Jeanne.
     
    Why should I lose weight? They make bigger overalls. And they sure don't make overalls for tiny ads:
    Thread Boost feature
    https://coderanch.com/t/674455/Thread-Boost-feature
      Bookmark Topic Watch Topic
    • New Topic