| <html> |
| <head> |
| <!-- Matomo --> |
| <script> |
| var _paq = window._paq = window._paq || []; |
| /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ |
| _paq.push(["setDoNotTrack", true]); |
| _paq.push(["disableCookies"]); |
| _paq.push(['trackPageView']); |
| _paq.push(['enableLinkTracking']); |
| (function() { |
| var u="https://analytics.apache.org/"; |
| _paq.push(['setTrackerUrl', u+'matomo.php']); |
| _paq.push(['setSiteId', '79']); |
| var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; |
| g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); |
| })(); |
| </script> |
| <!-- End Matomo Code --> |
| <meta http-equiv="Content-type" content="text/html; charset=utf-8"/> |
| <title>Grails Reference</title> |
| <link rel="stylesheet" href="../../css/ref.css" type="text/css" media="screen" title="Ref" charset="utf-8" /> |
| <link rel="icon" href="../../img/favicon.ico" type="image/x-icon"/> |
| <link rel="shortcut icon" href="../../img/favicon.ico" type="image/x-icon"/> |
| </head> |
| <body class="body"> |
| <h1>install-dependency </h1><p class="paragraph"/><h2>Purpose</h2><p class="paragraph"/>Installs a JAR dependency, making it available to Grails <a href="../../guide/single.html#3.7 Dependency Resolution" class="guide">dependency resolution</a> mechanism.<p class="paragraph"/><h2>Examples</h2><p class="paragraph"/><div class="code"><pre>grails install-dependency mysql:mysql-connector-java:5.1.5 |
| grails install-dependency mysql:mysql-connector-java:5.1.5 --dir=lib |
| grails install-dependency --group=mysql --name=mysql-connector-java --version=5.1.5</pre></div><p class="paragraph"/><h2>Description</h2><p class="paragraph"/>Usage: |
| <div class="code"><pre>grails install-dependency [dependency]</pre></div><p class="paragraph"/>Arguments: |
| <ul class="star"> |
| <li><code>group</code> - The group of the dependency</li> |
| <li><code>name</code> - The name of the dependency</li> |
| <li><code>version</code> - The version of the dependency</li> |
| <li><code>repository</code> - The repository to resolve from</li> |
| <li><code>dir</code> - The target directory to resolve JAR files to</li> |
| </ul><p class="paragraph"/>The <code>install-dependency</code> command allows the installation of a JAR dependency into the Ivy cache so that it can be resolved locally (without needing to configure a repository explicitly).<p class="paragraph"/>In its most simple form you can pass a single argument that defines the dependency in the form "group:name:version":<p class="paragraph"/><div class="code"><pre>grails install-dependency mysql:mysql-connector-java:5.1.5</pre></div><p class="paragraph"/>Grails has some built in common public Maven repositories that will be used to resolve the dependency. If the dependency is not found you can specify your own repository using the <code>repository</code> argument:<p class="paragraph"/><div class="code"><pre>grails install-dependency mysql:mysql-connector-java:5.1.5 --repository=http://download.java.net/maven/2</pre></div><p class="paragraph"/>By default the JARs will be resolved to your local Ivy cache (typically <code>USER_HOME/.ivy2/cache</code>), if you wish the JAR files to be placed in an alternative directory you can use the <code>dir</code> argument:<p class="paragraph"/><div class="code"><pre></pre></div> |
| grails install-dependency mysql:mysql-connector-java:5.1.5 --dir=lib |
| <div class="code"><pre></pre></div> |
| |
| </body> |
| </html> |