3

I can find no question even slightly addressing this, so I imagine I'm missing something important, but I would appreciate if someone could even tell me that.

I have recently been self-learning some programming languages, and I can't figure out the conceptual difference between Grape, the JAR dependency manager within Groovy, and yum, the command-line package-management utility in Linux.

In the video instruction I'm watching, the professor used Grape within the Linux command line to install a package and its dependencies, which is what yum is used for. Is Grape simply the Groovy-specific version of the Linux-specific yum? Or is there a more fundamental difference?

M. Justin
  • 14,487
  • 7
  • 91
  • 130
Sean Branchaw
  • 597
  • 1
  • 5
  • 21
  • Can you give an example? – Opal Oct 13 '15 at 14:28
  • another difference is "where" stuff gets installed. package managers (yum is just one of them and other linux distributions use other tools) install software (usually) system wide. grapes (usually) download pom/jar files in a per-user cache. – cfrick Oct 13 '15 at 15:55
  • @Opal @Grapes(@Grab(group='joda-time', module='joda-time', version='2.3')) would be the Grapes example, and "yum install postgresql.x86_64" would be the yum example. – Sean Branchaw Oct 13 '15 at 15:57
  • You stated that *professor used Grape within the Linux command line to install a package and its dependencies*, could you please provide an example? – Opal Oct 13 '15 at 19:02

1 Answers1

3
  • TL;DR: yum is for installing OS specific applications or libraries, and Grab is for adding jvm dependencies to a Groovy application

Yum is; (from wikipedia)

an open-source command-line package-management utility for Linux operating systems using the RPM Package Manager

Grape (in Groovy) is; (from the Groovy documentation)

a JAR dependency manager embedded into Groovy. Grape lets you quickly add maven repository dependencies to your classpath, making scripting even easier

The Java ecosystem has libraries stored in (generally) maven repositories.

In Groovy, Grab allows you to pull one of these JVM libraries (and all of its dependencies) out of a Maven repository, and it adds them to the classpath of your running script.

tim_yates
  • 167,322
  • 27
  • 342
  • 338