1

I've installed grails-2.3.6 and Maven 3.2.1 on my Windows 7 machine. If I check to see that Maven is set up correctly, I get the following command-line output:

D:\>mvn --version
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T12:2-05:00)
Maven home: D:\apache-maven-3.2.1\bin\..
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_51\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

So I know Maven is installed.

I also know Grails is (at least partially) installed correctly, because I am able to issue commands like grails run-app, etc. and have them work.

I am now trying to issue a grail maven-install and am getting the following exception:

C:\>cd C:\myProj\myApp
C:\myProj\myApp>grails maven-install

| Script 'MavenInstall' not found, did you mean:
    1) UninstallPlugin
    2) InstallPlugin
    3) InstallDependency
    4) InstallTemplates
    5) InstallAppTemplates_
> Please make a selection or enter Q to quit:

So it's like my Grails installation is missing whatever component maven-install maps to. Ideas as to how to fix this?

AdjustingForInflation
  • 1,571
  • 2
  • 26
  • 50
  • 1
    What is the purpose of using `grails maven-install`? This command is part of release plugin and is used to release plugins. There is altogether a different way to mavenize a grails app. – dmahapatro Apr 02 '14 at 15:14
  • Thanks @dmahapatro (+1) - can you please fill me in on how `grails maven-install` relates to `grails install-plugin maven-publisher`? Thanks again! – AdjustingForInflation Apr 02 '14 at 15:49

2 Answers2

3

You don't need Maven installed to do this. The script copies files to your local $HOME/.m2 repo in the format of a standard Maven repo, and then Ivy and/or Aether (in Grails 2.3+) will be able to access the files.

The script is available in the http://grails.org/plugin/release plugin. This is the newer version of the old and deprecated "maven-publisher" plugin that @Mysterion referenced.

If you're using Grails 2.2.x or lower, add this to

build ':release:2.2.1', ':rest-client-builder:1.0.3', {
   export = false
}

and if you're using 2.3+ add this:

build ':release:3.0.1', ':rest-client-builder:1.0.3', {
   export = false
}

Then run grails compile to resolve ("install") the plugin.

Burt Beckwith
  • 75,342
  • 5
  • 143
  • 156
1

My bet is that you need to install maven-publisher plugin first by doing this - grails install-plugin maven-publisher and then run needed command

Taken from here - http://grails.org/plugin/maven-publisher

UPD. According to tim_yates comment - this is deprecate way to do it

Mysterion
  • 9,050
  • 3
  • 30
  • 52
  • 1
    You shouldn't do `grails install-plugin` with modern versions of grails, instead add `compile ":maven-publisher:0.8.1"` to BuildConfig plugins, and run `grails compile` – tim_yates Apr 02 '14 at 15:06
  • @tim_yates, which version of grails starts to be modern? – Mysterion Apr 02 '14 at 15:09
  • 1
    It's first mentioned in [2.1.5 and 2.2.1](http://grails.org/doc/2.1.5/ref/Command%20Line/install-plugin.html), and gets a full on deprecation message in [2.2.3](http://grails.org/doc/2.2.3/ref/Command%20Line/install-plugin.html) – tim_yates Apr 02 '14 at 15:17
  • Thanks @Mysterion (+1) - can you please fill me in on how `grails maven-install` relates to `grails install-plugin maven-publisher`? Thanks again! – AdjustingForInflation Apr 02 '14 at 15:48