You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Sankar Narayanan <me...@gmail.com> on 2016/08/22 09:00:44 UTC

Build Issue with Gradle

Hi,

I am facing the below issue while trying to build kafka using gradle.  can
you please help?

 installed grade 3.0 and then git clone kafka from apache site. Then I ran
gradle under kafka folder. But I got the error "No such property: useAnt
for class: org.gradle.api.tasks.scala.ScalaCompileOptions". I looked at
build.gradle for useAnt and removed that line. The error still persisted.
Even I removed all scalsCompile related part from build.gradle I still get
the same error.

I searched online and found that useAnt is deprecated in gradle 3.0, but
why this error still happen if I removed useAnt from build.gradle?

Thanks,

Re: Build Issue with Gradle

Posted by Ismael Juma <is...@juma.me.uk>.
Hi Sankar,

The following PR fixes the issue:

https://github.com/apache/kafka/pull/1774

Ismael

On Mon, Aug 22, 2016 at 10:00 AM, Sankar Narayanan <
meetshankarhere@gmail.com> wrote:

> Hi,
>
> I am facing the below issue while trying to build kafka using gradle.  can
> you please help?
>
>  installed grade 3.0 and then git clone kafka from apache site. Then I ran
> gradle under kafka folder. But I got the error "No such property: useAnt
> for class: org.gradle.api.tasks.scala.ScalaCompileOptions". I looked at
> build.gradle for useAnt and removed that line. The error still persisted.
> Even I removed all scalsCompile related part from build.gradle I still get
> the same error.
>
> I searched online and found that useAnt is deprecated in gradle 3.0, but
> why this error still happen if I removed useAnt from build.gradle?
>
> Thanks,
>

RE: Build Issue with Gradle

Posted by Martin Gainty <mg...@hotmail.com>.
gradle hides alot of details such as how the package jars (how does assembly/package include external resources such as dlls?)

also the gradle scala -> java conversion was empty so I retasked kafka core and client modules to regular maven pom.xml

I am currently correcting my way thru 100+ compile Scala errors (HINT: I am using suffix .asScala() alot)
My feeling is if you spend more than 5 min on something (gradle) with no resolution then you need to try something else so
if you email me directly I will send you the pom.xml that I have for the specific kafka module you are working on
The end result would be a build to clearly illustrate whats going on and to *not* hide or obfuscate any necessary detailsif the build dependencies need a dependency maven will tell you
if you have wrong version of an artifact maven will tell you
if maven cant find a resource it will tell you
If there are compile errors it will tell youIf you want specific functionality that nobody else has accomplished you can easily write a custom mojo and integrate to <build>
*Best Regards*
Martin 
______________________________________________ 



> From: mathieu.fenniak@replicon.com
> Date: Tue, 23 Aug 2016 06:36:09 -0600
> Subject: Re: Build Issue with Gradle
> To: users@kafka.apache.org
> 
> Oh, that's interesting.  It looks like the Gradle Wrapper's jar file
> was intentionally removed from the kafka source tree
> (https://issues.apache.org/jira/browse/KAFKA-2098), which would cause
> this error.  The README file in the repo says to run "gradle" first,
> which will install the wrapper binary, which you can then use... but
> this doesn't work when using gradle 3.0 due to the incompatibility
> introduced.
> 
> The best approach is probably to install an older version of gradle
> with homebrew.  This ought to work:
> 
> brew unlink gradle
> brew tap homebrew/versions
> brew install gradle28
> 
> Then you should be able to follow the README instructions, which start
> with running gradle, then using the gradle wrapper for any builds you
> want to run.
> 
> Mathieu
> 
> 
> 
> On Tue, Aug 23, 2016 at 6:21 AM, Sankar Narayanan
> <me...@gmail.com> wrote:
> > Hi,
> >
> > I got your response as below.
> >
> > "Hi Sankar,
> >
> > It looks like Kafka's build scripts are not compatible with Gradle
> > 3.0.  I'd suggest using the gradle wrapper (./gradlew) included in the
> > Kafka repo, which will automatically install Gradle 2.13 which is
> > compatible with the build scripts.
> >
> > Mathieu",
> >
> >
> > When i tried running gradle wrapper (./gradlew) directly, am getting
> > the following error.
> >
> > and is the reason i tried installing gradle using homebrew, which
> > finally ended up installing gradle 3.0 .  Can you please help on to
> > overcome the below error?
> >
> >
> > $ ./gradlew
> >
> > Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
> >
> > Thanks,
> >
> >
> >
> > On Mon, Aug 22, 2016 at 2:30 PM, Sankar Narayanan <meetshankarhere@gmail.com
> >> wrote:
> >
> >> Hi,
> >>
> >> I am facing the below issue while trying to build kafka using gradle.  can
> >> you please help?
> >>
> >>  installed grade 3.0 and then git clone kafka from apache site. Then I ran
> >> gradle under kafka folder. But I got the error "No such property: useAnt
> >> for class: org.gradle.api.tasks.scala.ScalaCompileOptions". I looked at
> >> build.gradle for useAnt and removed that line. The error still persisted.
> >> Even I removed all scalsCompile related part from build.gradle I still get
> >> the same error.
> >>
> >> I searched online and found that useAnt is deprecated in gradle 3.0, but
> >> why this error still happen if I removed useAnt from build.gradle?
> >>
> >> Thanks,
> >>
 		 	   		  

Re: Build Issue with Gradle

Posted by Mathieu Fenniak <ma...@replicon.com>.
Oh, that's interesting.  It looks like the Gradle Wrapper's jar file
was intentionally removed from the kafka source tree
(https://issues.apache.org/jira/browse/KAFKA-2098), which would cause
this error.  The README file in the repo says to run "gradle" first,
which will install the wrapper binary, which you can then use... but
this doesn't work when using gradle 3.0 due to the incompatibility
introduced.

The best approach is probably to install an older version of gradle
with homebrew.  This ought to work:

brew unlink gradle
brew tap homebrew/versions
brew install gradle28

Then you should be able to follow the README instructions, which start
with running gradle, then using the gradle wrapper for any builds you
want to run.

Mathieu



On Tue, Aug 23, 2016 at 6:21 AM, Sankar Narayanan
<me...@gmail.com> wrote:
> Hi,
>
> I got your response as below.
>
> "Hi Sankar,
>
> It looks like Kafka's build scripts are not compatible with Gradle
> 3.0.  I'd suggest using the gradle wrapper (./gradlew) included in the
> Kafka repo, which will automatically install Gradle 2.13 which is
> compatible with the build scripts.
>
> Mathieu",
>
>
> When i tried running gradle wrapper (./gradlew) directly, am getting
> the following error.
>
> and is the reason i tried installing gradle using homebrew, which
> finally ended up installing gradle 3.0 .  Can you please help on to
> overcome the below error?
>
>
> $ ./gradlew
>
> Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
>
> Thanks,
>
>
>
> On Mon, Aug 22, 2016 at 2:30 PM, Sankar Narayanan <meetshankarhere@gmail.com
>> wrote:
>
>> Hi,
>>
>> I am facing the below issue while trying to build kafka using gradle.  can
>> you please help?
>>
>>  installed grade 3.0 and then git clone kafka from apache site. Then I ran
>> gradle under kafka folder. But I got the error "No such property: useAnt
>> for class: org.gradle.api.tasks.scala.ScalaCompileOptions". I looked at
>> build.gradle for useAnt and removed that line. The error still persisted.
>> Even I removed all scalsCompile related part from build.gradle I still get
>> the same error.
>>
>> I searched online and found that useAnt is deprecated in gradle 3.0, but
>> why this error still happen if I removed useAnt from build.gradle?
>>
>> Thanks,
>>

Re: Build Issue with Gradle

Posted by Sankar Narayanan <me...@gmail.com>.
Hi,

Thanks a lot! am able to build and import the projects in Eclipse now.

Thanks,

On Tue, Aug 23, 2016 at 5:51 PM, Sankar Narayanan <meetshankarhere@gmail.com
> wrote:

> Hi,
>
> I got your response as below.
>
> "Hi Sankar,
>
> It looks like Kafka's build scripts are not compatible with Gradle
> 3.0.  I'd suggest using the gradle wrapper (./gradlew) included in the
> Kafka repo, which will automatically install Gradle 2.13 which is
> compatible with the build scripts.
>
> Mathieu",
>
>
> When i tried running gradle wrapper (./gradlew) directly, am getting the following error.
>
> and is the reason i tried installing gradle using homebrew, which finally ended up installing gradle 3.0 .  Can you please help on to overcome the below error?
>
>
> $ ./gradlew
>
> Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
>
> Thanks,
>
>
>
> On Mon, Aug 22, 2016 at 2:30 PM, Sankar Narayanan <
> meetshankarhere@gmail.com> wrote:
>
>> Hi,
>>
>> I am facing the below issue while trying to build kafka using gradle.
>>  can you please help?
>>
>>  installed grade 3.0 and then git clone kafka from apache site. Then I
>> ran gradle under kafka folder. But I got the error "No such property:
>> useAnt for class: org.gradle.api.tasks.scala.ScalaCompileOptions". I
>> looked at build.gradle for useAnt and removed that line. The error still
>> persisted. Even I removed all scalsCompile related part from build.gradle I
>> still get the same error.
>>
>> I searched online and found that useAnt is deprecated in gradle 3.0, but
>> why this error still happen if I removed useAnt from build.gradle?
>>
>> Thanks,
>>
>
>

Re: Build Issue with Gradle

Posted by Sankar Narayanan <me...@gmail.com>.
Hi,

I got your response as below.

"Hi Sankar,

It looks like Kafka's build scripts are not compatible with Gradle
3.0.  I'd suggest using the gradle wrapper (./gradlew) included in the
Kafka repo, which will automatically install Gradle 2.13 which is
compatible with the build scripts.

Mathieu",


When i tried running gradle wrapper (./gradlew) directly, am getting
the following error.

and is the reason i tried installing gradle using homebrew, which
finally ended up installing gradle 3.0 .  Can you please help on to
overcome the below error?


$ ./gradlew

Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

Thanks,



On Mon, Aug 22, 2016 at 2:30 PM, Sankar Narayanan <meetshankarhere@gmail.com
> wrote:

> Hi,
>
> I am facing the below issue while trying to build kafka using gradle.  can
> you please help?
>
>  installed grade 3.0 and then git clone kafka from apache site. Then I ran
> gradle under kafka folder. But I got the error "No such property: useAnt
> for class: org.gradle.api.tasks.scala.ScalaCompileOptions". I looked at
> build.gradle for useAnt and removed that line. The error still persisted.
> Even I removed all scalsCompile related part from build.gradle I still get
> the same error.
>
> I searched online and found that useAnt is deprecated in gradle 3.0, but
> why this error still happen if I removed useAnt from build.gradle?
>
> Thanks,
>

Re: Build Issue with Gradle

Posted by Mathieu Fenniak <ma...@replicon.com>.
Hi Sankar,

It looks like Kafka's build scripts are not compatible with Gradle
3.0.  I'd suggest using the gradle wrapper (./gradlew) included in the
Kafka repo, which will automatically install Gradle 2.13 which is
compatible with the build scripts.

Mathieu


On Mon, Aug 22, 2016 at 3:00 AM, Sankar Narayanan
<me...@gmail.com> wrote:
> Hi,
>
> I am facing the below issue while trying to build kafka using gradle.  can
> you please help?
>
>  installed grade 3.0 and then git clone kafka from apache site. Then I ran
> gradle under kafka folder. But I got the error "No such property: useAnt
> for class: org.gradle.api.tasks.scala.ScalaCompileOptions". I looked at
> build.gradle for useAnt and removed that line. The error still persisted.
> Even I removed all scalsCompile related part from build.gradle I still get
> the same error.
>
> I searched online and found that useAnt is deprecated in gradle 3.0, but
> why this error still happen if I removed useAnt from build.gradle?
>
> Thanks,