• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Maven Dependencies

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So lets say I have a project setup using Maven. I need to add a dependency to the pom file. How do I go about knowing the groupId (I think this is just the package up to the project name), artifactId and version without visiting the site for every project?
 
Saloon Keeper
Posts: 27763
196
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
You can often deduce it from the package name. I'll admit, however, that a lot of times I just go to the Maven repository and browse for it.
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I also usually browse the maven repository. Some Maven IDE plugins (I know eclipse's - I think IDEAs also) allow you to search for dependencies - give it a term and it will return all groupid/artifactid matches it finds, and once you choose one, it will then allow you to choose from the available versions.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys. So if your hunting down that info, wouldn't it be just as easy to download the JAR(s) while your at at? Sorry, couldn't resist.
 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Gregg Bolinger:
Thanks guys. So if your hunting down that info, wouldn't it be just as easy to download the JAR(s) while your at at? Sorry, couldn't resist.



as long as you know the jar name, let's say spring, then you can go to
http://mvnrepository.com/ to search it there, enter spring in the search box, after clicking on the search button, then you will be displayed a bunch of spring related links, find the one you want to use then click the link, you will have the dependency snippet you need. then copy it to your pom.xml. do a mvn package, you will have it locally.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nathan Pruett:
Some Maven IDE plugins (I know eclipse's - I think IDEAs also) allow you to search for dependencies -



Not IDEA. Booo.
 
Tim Holloway
Saloon Keeper
Posts: 27763
196
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

Originally posted by Gregg Bolinger:
Thanks guys. So if your hunting down that info, wouldn't it be just as easy to download the JAR(s) while your at at? Sorry, couldn't resist.



Well, it's the difference between running up and down the web view of the maven archive like a demented squirrel until you find it and actually hauling in everything by the megabyte.
 
Hongli Li
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Gregg Bolinger:


Not IDEA. Booo.


IDEA have maven repository search plugin
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Hongli Li:

IDEA have maven repository search plugin



Link or name of plugin?
 
Hongli Li
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Gregg Bolinger:


Link or name of plugin?



maven repo search

http://plugins.intellij.net/plugin/?id=1696
 
I'm just a poor boy, I need no sympathy, because I'm easy come, easy go, little high, little low, little ad
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic