On 2019/03/25 11:25:59, Paul King <pa...@asert.com.au> wrote: 
> I wouldn't use those exact words. I would say something like:
> "Previous examples assumed that the consumer of the library will
> transitively want the Groovy jars on the classpath. For libraries that will
> be consumed in contexts where Groovy will already be on the classpath, you
> can consider altering your dependency scopes as follows:"
> 
> [build script sample as you have]
> 
> "Alternatively, you may wish to document to your users that they may need
> to exclude transitive dependencies or specifically exclude the Groovy jar
> to avoid having two (potentially conflicting) versions of Groovy on the
> classpath."
> 
> Cheers, Paul.
> 
> On Mon, Mar 25, 2019 at 6:07 PM anton.pryamosta...@gmail.com <
> anton.pryamosta...@gmail.com> wrote:
> 
> >
> >
> > On 2019/03/24 22:52:55, Paul King <pa...@asert.com.au> wrote:
> > > If your pom for this dependency 'io.infinite:supplies:1.1.1' mentions a
> > > specific version of groovy, then
> > > I would expect the kinds of errors you are seeing if you are loading
> > from a
> > > different version of Groovy.
> > > Either use the workarounds you mentioned on the gradle side - then you
> > have
> > > an implicit assumption
> > > that the library will always be used from a groovy environment with the
> > > needed dependencies, or add
> > > a @GrabExclude of Groovy on the Groovy side alongside your '@Grab(
> > > 'io.infinite:supplies:1.1.1')'.
> > >
> > > Cheers, Paul.
> > >
> > >
> > > On Mon, Mar 25, 2019 at 8:10 AM anton.pryamosta...@gmail.com <
> > > anton.pryamosta...@gmail.com> wrote:
> > >
> > > > Oh, I forgot to say: relevant thread on Gradle forum:
> > > >
> > https://discuss.gradle.org/t/gradle-groovy-library-scope-documentation-best-practices-grapes/31054
> > > >
> > > > It has some additional details (like workaround). Please kindly take a
> > > > look at that.
> > > >
> > > > Thank you.
> > > >
> > > > Bye (Anton)
> > > >
> > >
> >
> > Many thanks, Paul!
> >
> > Shall I initiate to change the Gradle documentation? Since it's a common
> > entry point for anyone writing Groovy library using Gradle build.
> >
> > My suggestion is to add there a block, saying - "For better compatibility
> > with other build tools, the recommended dependency scopes should be:"
> > ..
> > dependencies {
> >     compileOnly 'org.codehaus.groovy:groovy-all:2.5.4'
> >     testCompile 'org.codehaus.groovy:groovy-all:2.5.4'
> > ..
> > }
> > ..
> >

Brilliant, thanks Paul!
That will further address the risks of some degree of unasureness in relation 
to ivy/Maven/other build tools except Gradle and Grapes.
I will go ahead and submit PR to Grails documentation shortly.

Kind Regards,
Anton

Reply via email to