On Aug 22, 2011, at 5:17 PM, Vincent Massol wrote:
On Aug 22, 2011, at 4:26 PM, Sergiu Dumitriu wrote:
On 08/22/2011 10:18 AM, Vincent Massol wrote:
On Aug 22, 2011, at 4:06 PM, Sergiu Dumitriu wrote:
On 08/22/2011 04:43 AM, Vincent Massol wrote:
> Hi devs,
>
> I'd like to propose adding the Ivy JAR to our Platform/XE distributions.
>
> The reason is simple: it makes it possible to use the Groovy @Grab directive which
makes it real easy to extend XWiki using Groovy script.
> Several advantages:
> - not having to manually hunt for transitive dependencies
> - not needing to stop/restart XWiki (since this is what you need to do if your groovy
script needs to use some third party jars).
>
> Here's a good usage example:
-0.
It is a very cool feature, but I don't think it's something useful for a
majority of users. It's something very useful in a development wiki like
we have on
xwiki.org, but it adds almost 1M extra size, and increases
the classpath and the permgen requirements.
I think the extension manager would make it easy to install Ivy when needed.
With this reasoning we should remove groovy too (the macro) since the majority of users
don't need it. IMO they go together and we should leave them together.
So for me either we consider that for now we bundle the groovy macro and we add the ivy
dep or we remove the groovy macro by default.
Said differently I'd like to add the ivy dependency in the groovy macro's
pom.xml.
Another way of viewing this is that groovy-all.jar should have a dep on ivy by default (I
don't know why it doesn't and it may well add it in the future - I'll ask
Guillaume).
Yes, it should. I'm interested in Guillaume's motivation as well.
I've just checked and ivy dep is in the groovy-all pom.xml file but as an optional
dep:
<!-- Used for @Grab and Grapes -->
<dependency>
<groupId>org.apache.ivy</groupId>
<artifactId>ivy</artifactId>
<version>2.2.0</version>
<scope>compile</scope>
<optional>true</optional>
ahah… that's funny and ironic. It used to be there but thanks to Thomas Mortagne
it's no longer! :)
See
http://groovy.329449.n5.nabble.com/Ivy-dependency-in-groovy-all-maven-proje…
And
http://jira.codehaus.org/browse/GROOVY-3241
:)
Sergiu, in view of this, are you still against adding a dep to ivy in the groovy
macro's pom.xml? I'd like to go ahead with this for 3.2M3.
Thanks
-Vincent
-Vincent
>> Thanks
>> -Vincent
>>
>>>> {{cache}}
>>>> {{groovy}}
>>>> @Grab(group='org.codehaus.groovy.modules.http-builder',
module='http-builder', version='0.5.1')
>>>> import groovyx.net.http.RESTClient
>>>>
>>>> github = new RESTClient( 'http://github.com/api/v2/json/' )
>>>>
>>>> println "|=Project|=Description|=Use Wiki?|=Use Issues?"
>>>> def response = github.get( path : 'repos/show/xwiki' )
>>>> response.data.repositories.each() { repo ->
>>>> println
"|[[${repo.name}>>http://github.com/xwiki/${repo.name}]]|${repo.description}|${repo.has_wiki}|${repo.has_issues}"
>>>> }
>>>> {{/groovy}}
>>>> {{/cache}}
>>>>
>>>> If you try to do this without the grab directive you'll find yourself
hunting down more than 30 jars which you'll need to put in your WEB-INF/lib directory,
whereas here it's a single line directive. It's really powerful.
>>>>
>>>> Here's my +1 to make it easy for users to use Groovy scripts.
>>>>
>>>> Thanks
>>>> -Vincent