• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Maven and Eclipse - updating jar to newer version

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I hope it's OK to ask a newbie question about how to update a Maven built Eclipse project as I'm finding it very hard to get to grips with Maven and how it works.

I followed instructions in a book as to how to download and install a Maven project for Eclipse - mvn clean package and mvn eclipse:clean eclipse:eclipse and then create a new Eclipse project from the existing source.

However I now have to update one of the jar files to a newer version for a bug fix, and I don't know how. The updated jar is at http://repository.codehaus.org/org/mvel/mvel2/2.0.13/

I tried copying the new jar into the library folder where the other jars for the Eclipse plugin are stored and adding it to the build path of the project as an external jar (couldn't figure out how to get it in as part of the existing library) but it didn't work. Should I copy it to the Maven repository folder? Or do something with the short pom file that goes with the updated jar, like edit the original pom file on my system (which obviously covers a whole bunch of other jars) to add stuff from the short pom file, and if so which bits of the file? And how do I get Eclipse to recognise the new jar instead of the older version, will deleting the old jar from the filesystem be enough?

Any help would be very much appreciated. Thanks in advance.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should upgrade version dependencies in the POM.
 
Saloon Keeper
Posts: 25638
183
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably the Number 1 selling point of Maven is that it fetches and caches dependencies for you. You don't have to download the updated JAR, just update the version number of the JAR in your Maven POM file and do a clean and rebuild. When you do that, Maven will check your local repository (cache) and, if the jar hasn't already been downloaded, it will go to the maven repositories, find a copy, and download it (this is assuming you didn't do an offline build!). Then it will use that copy to do your new build with.
 
A F Jones
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your replies. I've found the POM file and will edit it.

I'm new to this so I'll just have to go figure out how to do a clean and rebuild - if you'll forgive that it's so basic, am I right in thinking that you go to the directory where the edited POM file is and do mvn clean then mvn install, please?
 
Tim Holloway
Saloon Keeper
Posts: 25638
183
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That usually works. You can abbreviate it to "mvn clean install", however.
 
A F Jones
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Tim I shall try that.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic