3

Is there a way to build a Grails Plugin and deploy the artifacts to the local Ivy repository?

With Maven, I would do this:

mvn install
Armand
  • 23,463
  • 20
  • 90
  • 119

1 Answers1

0

Use the ivy publish task

<ivy:publish resolver="local" pubrevision="1.0">
   <artifacts pattern="build/[artifact].[ext]" />
</ivy:publish>

Note 1

Your ivy file must list the artifacts you plan to publish

<ivy-module version="2.0">
  <info organisation="myorg" module="mymodule"/>
  <publications>
    <artifact name="mymodule" type="zip"/>
  </publications>
</ivy-module>

Maven derives this information from the module declaration in the POM file. One of the advantages of using ivy is that you can publish more than one artifact.

Note 2

The ivy local repository is located in the following location by default:

${user.dir}/.ivy2/local

You can of course create your own custom repositories by declaring alternative resolvers in you settings file

Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
  • Thanks for the info, Mark. Does this require a Maven POM defined for the grails project? That's not ideal, as (in my experience) most Grails projects use Gant instead of Maven. – Armand Sep 30 '12 at 11:48
  • You only need a POM when you are publishing to Maven repository. Ivy can do that too, see: http://stackoverflow.com/questions/5111831/how-to-publish-3rdparty-artifacts-with-ivy-and-nexus/5115447#5115447 – Mark O'Connor Sep 30 '12 at 14:06
  • Ah, is the XML above for ant? – Armand Sep 30 '12 at 15:56