You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Owen Thomas <ow...@gmail.com> on 2022/08/02 02:59:28 UTC

Gradle won't resolve dependency: what's wrong here?

Hello again. I am perplexed at the following problem.

I have a multi-project build in a directory named "CliqueSpace". It's
build.gradle file has the following:

subprojects {
    apply plugin: 'java'

    repositories {
        mavenCentral()
    }
}

The settings.gradle file or the same directory has the following:

rootProject.name = 'CliqueSpace'

include ':Concept'
include ':PeerDevice'

There are other includes in the above file, but I don't think it is
necessary to quote them here.

In the Concept directory (CliqueSpace/Concept), build.gradle contains the
following:

description = 'Concept'

In the PeerDevice directory (CliqueSpace/PeerDevice), build.gradle contains
the following:

description = 'PeerDevice'

dependencies {
    compile project(':Concept')
}

At the moment, I only feel confident using gradle from the CLI. So, when I
open a CLI window within the CliqueSpace directory, and run "gradle project
PeerDevice", I get the following:

owen@owen-Latitude-5511:~/Development/CliqueSpace/Code/trunk/CliqueSpace$
gradle project PeerDevice

FAILURE: Build failed with an exception.

* Where:
Build file
'/home/owen/Development/CliqueSpace/Code/trunk/CliqueSpace/PeerDevice/build.gradle'
line: 4

* What went wrong:
A problem occurred evaluating project ':PeerDevice'.
> Could not find method compile() for arguments [project ':Concept'] on
object of type
org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or
--debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 493ms

In short, having followed the instructions from a few different sources
now, I don't know what I'm doing wrong. It might be good for the reader to
know that Concept/src/main/java has source code in it that compiles, but
PeerDevice/src/main/java also has source code where almost every Java
module has broken out in a rash of unresolved dependencies.

Thanks for any help,

  Owen.

Re: Gradle won't resolve dependency: what's wrong here?

Posted by Scott Palmer <sw...@gmail.com>.

> On Aug 4, 2022, at 7:37 AM, Owen Thomas <ow...@gmail.com> wrote:
> 
> On Thu, 4 Aug 2022 at 15:54, László Kishalmi <laszlo.kishalmi@gmail.com <ma...@gmail.com>> wrote:
> Compile was discouraged at 3.4, marked for deprecation in  4.0 they removed it in 7.0. that's pretty long time. 4 years
> 
> No problem. I'll just have to be mindful of this when following advice from people about Gradle.
> 
> Thanks all. Until next time. :)

This is why use of the Gradle wrapper is encouraged.. control the version of the tool so your builds are more stable.
(Though I admit I like to stay on the bleeding edge and keep my build scripts compatible with the current version.)

Scott


Re: Re: Gradle won't resolve dependency: what's wrong here?

Posted by Owen Thomas <ow...@gmail.com>.
On Thu, 4 Aug 2022 at 15:54, László Kishalmi <la...@gmail.com>
wrote:

> Compile was discouraged at 3.4, marked for deprecation in  4.0 they
> removed it in 7.0. that's pretty long time. 4 years
>

No problem. I'll just have to be mindful of this when following advice from
people about Gradle.

Thanks all. Until next time. :)

Re: Re: Gradle won't resolve dependency: what's wrong here?

Posted by Andreas Reichel <an...@manticore-projects.com>.

On Wed, 2022-08-03 at 22:54 -0700, László Kishalmi wrote:
> Compile was discouraged at 3.4, marked for deprecation in  4.0 they
> removed it in 7.0. that's pretty long time. 4 years.

Apologies when digressing too far: 4 years looks pretty long, although
there are still tons of documentation and samples all over the internet
referring to it.
Especially when diving into more obscure Gradle Plugins like JavaCC,
one is better off ignoring any documentation at all and reading the
code instead.

I love Gradle, so much. But is this particular regard, its a mess.

Cheers
Andreas

Re: Re: Gradle won't resolve dependency: what's wrong here?

Posted by László Kishalmi <la...@gmail.com>.
Compile was discouraged at 3.4, marked for deprecation in  4.0 they removed
it in 7.0. that's pretty long time. 4 years.



On Wed, Aug 3, 2022, 20:51 Owen Thomas <ow...@gmail.com> wrote:

>
>
> On Thu, 4 Aug 2022 at 12:37, Andreas Reichel <
> andreas@manticore-projects.com> wrote:
>
>> Just be prepared. Its still very much worth it in my opinion.
>>
>
> Thanks Andreas. Yea, even though, if I were Gradle, I might have kept the
> "compile" option for a while longer, I think backwards compatibility might
> be a little overrated too. :)
>

Re: Re: Gradle won't resolve dependency: what's wrong here?

Posted by Owen Thomas <ow...@gmail.com>.
On Thu, 4 Aug 2022 at 12:37, Andreas Reichel <an...@manticore-projects.com>
wrote:

> Just be prepared. Its still very much worth it in my opinion.
>

Thanks Andreas. Yea, even though, if I were Gradle, I might have kept the
"compile" option for a while longer, I think backwards compatibility might
be a little overrated too. :)

Re: Re: Gradle won't resolve dependency: what's wrong here?

Posted by Andreas Reichel <an...@manticore-projects.com>.
Owens,

On Thu, 2022-08-04 at 12:29 +1000, Owen Thomas wrote:
> I observe that Gradle isn't fussed about backwards compatibility as
> much as Java.

you are spot on. While I love Gradle, I found that features change
faster than documentation and examples can keep up.
You will find lots of outdated stuff and plugins lacking examples and
documentation.

Just be prepared. Its still very much worth it in my opinion.

Cheers
Andreas


Re: Re: Gradle won't resolve dependency: what's wrong here?

Posted by Owen Thomas <ow...@gmail.com>.
Indeed Eric. Thankfully, I found the answer and the remainder of the
conversion to Gradle went reasonably smoothly over source code which
currently calls nothing but Java SE currently. That might now change
without too much added complication.

I observe that Gradle isn't fussed about backwards compatibility as much as
Java.

On Thu, 4 Aug 2022 at 04:01, Eric Bresie <eb...@gmail.com> wrote:

> Think there have been some changes in Gradle around compile and
> implementation (1).  May depend on what version of Gradle is in use as well.
>
> Eric Bresie
> Ebresie@gmail.com
>
> (1) https://tomgregory.com/gradle-implementation-vs-compile-dependencies/
>
> On August 2, 2022 at 1:46:54 AM CDT, Owen Thomas <
> owen.paul.thomas@gmail.com> wrote:
> And restarting NetBeans (after rebooting my laptop) seems to have cleared
> the PeerDevice project of its rash. Now to include the remainder of the
> projects...
>
> On Tue, 2 Aug 2022 at 16:23, Owen Thomas <ow...@gmail.com>
> wrote:
>
>> Hey Laszlo.
>>
>> Sorry for not doing as you have asked, but while you were probably
>> composing your message, my Gradle project built!
>>
>> I don't know if that means that I'm good - (it usually doesn't) I need to
>> add a lot more subprojects to the root project - but all I did was to
>> change CliqueSpace/PeerDevice/build.gradle from:
>>
>> description = 'PeerDevice'
>>
>> dependencies {
>>     *compile* project(':Concept')
>> }
>>
>> to:
>> description = 'PeerDevice'
>>
>> dependencies {
>>     *implementation* project(':Concept')
>> }
>>
>> NetBeans is still telling me that the source code within the PeerDevice
>> project is not compiling. Perhaps there is a caching problem. (?)
>>
>> I hope I'm on to something. If perhaps I'm not, then please let me know.
>> This might also give you more information about the problem I'm having and
>> equip you or others with more pointers.
>>
>>   Owen.
>>
>> On Tue, 2 Aug 2022 at 15:50, Laszlo Kishalmi <la...@gmail.com>
>> wrote:
>>
>>> Well, I've done and see a few dozen of Gradle builds, though this sounds
>>> alien to me. If you could share your project structure (main folders and
>>> their build.gradle files, maybe we can help sort this thing out.
>>> On 8/1/22 22:39, Owen Thomas wrote:
>>>
>>> While I've been doing other things, I have come to the conclusion that I
>>> need something, possibly in my build.gradle file of the Concept project,
>>> that refers to the Groovy method "compile". Perhaps I will need to start
>>> here.
>>>
>>> On Tue, 2 Aug 2022 at 14:02, Jason Abreu <ja...@gmail.com> wrote:
>>>
>>>> When I converted about 30 projects from Any to Gradle, including
>>>> multiple multi-project builds, I noticed a few peculiar things.
>>>>
>>>> Firstly, NetBeans gets a background task hung up every now and then.
>>>> The only solution for this was to exit NetBeans then find the hung up task
>>>> and kill it.  Once NetBeans restarted, the project scanning worked as
>>>> expected once more.
>>>>
>>>> Secondly, I have noticed that the Gradle dependency cache can get stale
>>>> and not refresh from repositories.  For this I would execute the Gradle
>>>> build task with the "--refresh-dependencies" (or something like that)
>>>> option to force Gradle to pull a fresh copy of the dependencies from the
>>>> repositories.
>>>>
>>>> Hope this helps!  I still consider myself new-ish to Gradle.  I do find
>>>> most of the support I need there in the NetBeans IDE for it, though.
>>>> However, my complaints about NetBeans relate to their lack of Jakarta EE 9
>>>> support, so far - but that's not anything to do with Gradle.
>>>>
>>>> --Jason
>>>>
>>>> On Mon, Aug 1, 2022, 22:59 Owen Thomas <ow...@gmail.com>
>>>> wrote:
>>>>
>>>>> Hello again. I am perplexed at the following problem.
>>>>>
>>>>> I have a multi-project build in a directory named "CliqueSpace". It's
>>>>> build.gradle file has the following:
>>>>>
>>>>> subprojects {
>>>>>     apply plugin: 'java'
>>>>>
>>>>>     repositories {
>>>>>         mavenCentral()
>>>>>     }
>>>>> }
>>>>>
>>>>> The settings.gradle file or the same directory has the following:
>>>>>
>>>>> rootProject.name = 'CliqueSpace'
>>>>>
>>>>> include ':Concept'
>>>>> include ':PeerDevice'
>>>>>
>>>>> There are other includes in the above file, but I don't think it is
>>>>> necessary to quote them here.
>>>>>
>>>>> In the Concept directory (CliqueSpace/Concept), build.gradle contains
>>>>> the following:
>>>>>
>>>>> description = 'Concept'
>>>>>
>>>>> In the PeerDevice directory (CliqueSpace/PeerDevice), build.gradle
>>>>> contains the following:
>>>>>
>>>>> description = 'PeerDevice'
>>>>>
>>>>> dependencies {
>>>>>     compile project(':Concept')
>>>>> }
>>>>>
>>>>> At the moment, I only feel confident using gradle from the CLI. So,
>>>>> when I open a CLI window within the CliqueSpace directory, and run "gradle
>>>>> project PeerDevice", I get the following:
>>>>>
>>>>> owen@owen-Latitude-5511:~/Development/CliqueSpace/Code/trunk/CliqueSpace$
>>>>> gradle project PeerDevice
>>>>>
>>>>> FAILURE: Build failed with an exception.
>>>>>
>>>>> * Where:
>>>>> Build file
>>>>> '/home/owen/Development/CliqueSpace/Code/trunk/CliqueSpace/PeerDevice/build.gradle'
>>>>> line: 4
>>>>>
>>>>> * What went wrong:
>>>>> A problem occurred evaluating project ':PeerDevice'.
>>>>> > Could not find method compile() for arguments [project ':Concept']
>>>>> on object of type
>>>>> org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
>>>>>
>>>>> * Try:
>>>>> Run with --stacktrace option to get the stack trace. Run with --info
>>>>> or --debug option to get more log output. Run with --scan to get full
>>>>> insights.
>>>>>
>>>>> * Get more help at https://help.gradle.org
>>>>>
>>>>> BUILD FAILED in 493ms
>>>>>
>>>>> In short, having followed the instructions from a few different
>>>>> sources now, I don't know what I'm doing wrong. It might be good for the
>>>>> reader to know that Concept/src/main/java has source code in it that
>>>>> compiles, but PeerDevice/src/main/java also has source code where almost
>>>>> every Java module has broken out in a rash of unresolved dependencies.
>>>>>
>>>>> Thanks for any help,
>>>>>
>>>>>   Owen.
>>>>>
>>>>

Re: Re: Gradle won't resolve dependency: what's wrong here?

Posted by Eric Bresie <eb...@gmail.com>.
Think there have been some changes in Gradle around compile and implementation (1). May depend on what version of Gradle is in use as well.

Eric Bresie
Ebresie@gmail.com (mailto:Ebresie@gmail.com)

(1) https://tomgregory.com/gradle-implementation-vs-compile-dependencies/

> On August 2, 2022 at 1:46:54 AM CDT, Owen Thomas <owen.paul.thomas@gmail.com (mailto:owen.paul.thomas@gmail.com)> wrote:
> And restarting NetBeans (after rebooting my laptop) seems to have cleared the PeerDevice project of its rash. Now to include the remainder of the projects...
>
> On Tue, 2 Aug 2022 at 16:23, Owen Thomas <owen.paul.thomas@gmail.com (mailto:owen.paul.thomas@gmail.com)> wrote:
> > Hey Laszlo.
> >
> > Sorry for not doing as you have asked, but while you were probably composing your message, my Gradle project built!
> >
> > I don't know if that means that I'm good - (it usually doesn't) I need to add a lot more subprojects to the root project - but all I did was to change CliqueSpace/PeerDevice/build.gradle from:
> >
> > description = 'PeerDevice'
> >
> > dependencies {
> > compile project(':Concept')
> > }
> >
> > to:
> > description = 'PeerDevice'
> >
> > dependencies {
> > implementation project(':Concept')
> > }
> >
> > NetBeans is still telling me that the source code within the PeerDevice project is not compiling. Perhaps there is a caching problem. (?)
> >
> > I hope I'm on to something. If perhaps I'm not, then please let me know. This might also give you more information about the problem I'm having and equip you or others with more pointers.
> >
> > Owen.
> >
> > On Tue, 2 Aug 2022 at 15:50, Laszlo Kishalmi <laszlo.kishalmi@gmail.com (mailto:laszlo.kishalmi@gmail.com)> wrote:
> > >
> > > Well, I've done and see a few dozen of Gradle builds, though this sounds alien to me. If you could share your project structure (main folders and their build.gradle files, maybe we can help sort this thing out.
> > >
> > >
> > > On 8/1/22 22:39, Owen Thomas wrote:
> > > > While I've been doing other things, I have come to the conclusion that I need something, possibly in my build.gradle file of the Concept project, that refers to the Groovy method "compile". Perhaps I will need to start here.
> > > > On Tue, 2 Aug 2022 at 14:02, Jason Abreu <jace.abreu@gmail.com (mailto:jace.abreu@gmail.com)> wrote:
> > > > > When I converted about 30 projects from Any to Gradle, including multiple multi-project builds, I noticed a few peculiar things.
> > > > >
> > > > > Firstly, NetBeans gets a background task hung up every now and then. The only solution for this was to exit NetBeans then find the hung up task and kill it. Once NetBeans restarted, the project scanning worked as expected once more.
> > > > >
> > > > > Secondly, I have noticed that the Gradle dependency cache can get stale and not refresh from repositories. For this I would execute the Gradle build task with the "--refresh-dependencies" (or something like that) option to force Gradle to pull a fresh copy of the dependencies from the repositories.
> > > > >
> > > > > Hope this helps! I still consider myself new-ish to Gradle. I do find most of the support I need there in the NetBeans IDE for it, though. However, my complaints about NetBeans relate to their lack of Jakarta EE 9 support, so far - but that's not anything to do with Gradle.
> > > > >
> > > > > --Jason
> > > > > On Mon, Aug 1, 2022, 22:59 Owen Thomas <owen.paul.thomas@gmail.com (mailto:owen.paul.thomas@gmail.com)> wrote:
> > > > > > Hello again. I am perplexed at the following problem.
> > > > > >
> > > > > > I have a multi-project build in a directory named "CliqueSpace". It's build.gradle file has the following:
> > > > > >
> > > > > > subprojects {
> > > > > > apply plugin: 'java'
> > > > > >
> > > > > > repositories {
> > > > > > mavenCentral()
> > > > > > }
> > > > > > }
> > > > > >
> > > > > > The settings.gradle file or the same directory has the following:
> > > > > >
> > > > > > rootProject.name = 'CliqueSpace'
> > > > > >
> > > > > > include ':Concept'
> > > > > > include ':PeerDevice'
> > > > > >
> > > > > > There are other includes in the above file, but I don't think it is necessary to quote them here.
> > > > > >
> > > > > > In the Concept directory (CliqueSpace/Concept), build.gradle contains the following:
> > > > > >
> > > > > > description = 'Concept'
> > > > > >
> > > > > > In the PeerDevice directory (CliqueSpace/PeerDevice), build.gradle contains the following:
> > > > > >
> > > > > > description = 'PeerDevice'
> > > > > >
> > > > > > dependencies {
> > > > > > compile project(':Concept')
> > > > > > }
> > > > > >
> > > > > > At the moment, I only feel confident using gradle from the CLI. So, when I open a CLI window within the CliqueSpace directory, and run "gradle project PeerDevice", I get the following:
> > > > > >
> > > > > > owen@owen-Latitude-5511:~/Development/CliqueSpace/Code/trunk/CliqueSpace$ gradle project PeerDevice
> > > > > >
> > > > > > FAILURE: Build failed with an exception.
> > > > > >
> > > > > > * Where:
> > > > > > Build file '/home/owen/Development/CliqueSpace/Code/trunk/CliqueSpace/PeerDevice/build.gradle' line: 4
> > > > > >
> > > > > > * What went wrong:
> > > > > > A problem occurred evaluating project ':PeerDevice'.
> > > > > > > Could not find method compile() for arguments [project ':Concept'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
> > > > > >
> > > > > > * Try:
> > > > > > Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
> > > > > >
> > > > > > * Get more help at https://help.gradle.org
> > > > > >
> > > > > > BUILD FAILED in 493ms
> > > > > >
> > > > > > In short, having followed the instructions from a few different sources now, I don't know what I'm doing wrong. It might be good for the reader to know that Concept/src/main/java has source code in it that compiles, but PeerDevice/src/main/java also has source code where almost every Java module has broken out in a rash of unresolved dependencies.
> > > > > >
> > > > > > Thanks for any help,
> > > > > >
> > > > > > Owen.

Re: Gradle won't resolve dependency: what's wrong here?

Posted by Owen Thomas <ow...@gmail.com>.
And restarting NetBeans (after rebooting my laptop) seems to have cleared
the PeerDevice project of its rash. Now to include the remainder of the
projects...

On Tue, 2 Aug 2022 at 16:23, Owen Thomas <ow...@gmail.com> wrote:

> Hey Laszlo.
>
> Sorry for not doing as you have asked, but while you were probably
> composing your message, my Gradle project built!
>
> I don't know if that means that I'm good - (it usually doesn't) I need to
> add a lot more subprojects to the root project - but all I did was to
> change CliqueSpace/PeerDevice/build.gradle from:
>
> description = 'PeerDevice'
>
> dependencies {
>     *compile* project(':Concept')
> }
>
> to:
> description = 'PeerDevice'
>
> dependencies {
>     *implementation* project(':Concept')
> }
>
> NetBeans is still telling me that the source code within the PeerDevice
> project is not compiling. Perhaps there is a caching problem. (?)
>
> I hope I'm on to something. If perhaps I'm not, then please let me know.
> This might also give you more information about the problem I'm having and
> equip you or others with more pointers.
>
>   Owen.
>
> On Tue, 2 Aug 2022 at 15:50, Laszlo Kishalmi <la...@gmail.com>
> wrote:
>
>> Well, I've done and see a few dozen of Gradle builds, though this sounds
>> alien to me. If you could share your project structure (main folders and
>> their build.gradle files, maybe we can help sort this thing out.
>> On 8/1/22 22:39, Owen Thomas wrote:
>>
>> While I've been doing other things, I have come to the conclusion that I
>> need something, possibly in my build.gradle file of the Concept project,
>> that refers to the Groovy method "compile". Perhaps I will need to start
>> here.
>>
>> On Tue, 2 Aug 2022 at 14:02, Jason Abreu <ja...@gmail.com> wrote:
>>
>>> When I converted about 30 projects from Any to Gradle, including
>>> multiple multi-project builds, I noticed a few peculiar things.
>>>
>>> Firstly, NetBeans gets a background task hung up every now and then.
>>> The only solution for this was to exit NetBeans then find the hung up task
>>> and kill it.  Once NetBeans restarted, the project scanning worked as
>>> expected once more.
>>>
>>> Secondly, I have noticed that the Gradle dependency cache can get stale
>>> and not refresh from repositories.  For this I would execute the Gradle
>>> build task with the "--refresh-dependencies" (or something like that)
>>> option to force Gradle to pull a fresh copy of the dependencies from the
>>> repositories.
>>>
>>> Hope this helps!  I still consider myself new-ish to Gradle.  I do find
>>> most of the support I need there in the NetBeans IDE for it, though.
>>> However, my complaints about NetBeans relate to their lack of Jakarta EE 9
>>> support, so far - but that's not anything to do with Gradle.
>>>
>>> --Jason
>>>
>>> On Mon, Aug 1, 2022, 22:59 Owen Thomas <ow...@gmail.com>
>>> wrote:
>>>
>>>> Hello again. I am perplexed at the following problem.
>>>>
>>>> I have a multi-project build in a directory named "CliqueSpace". It's
>>>> build.gradle file has the following:
>>>>
>>>> subprojects {
>>>>     apply plugin: 'java'
>>>>
>>>>     repositories {
>>>>         mavenCentral()
>>>>     }
>>>> }
>>>>
>>>> The settings.gradle file or the same directory has the following:
>>>>
>>>> rootProject.name = 'CliqueSpace'
>>>>
>>>> include ':Concept'
>>>> include ':PeerDevice'
>>>>
>>>> There are other includes in the above file, but I don't think it is
>>>> necessary to quote them here.
>>>>
>>>> In the Concept directory (CliqueSpace/Concept), build.gradle contains
>>>> the following:
>>>>
>>>> description = 'Concept'
>>>>
>>>> In the PeerDevice directory (CliqueSpace/PeerDevice), build.gradle
>>>> contains the following:
>>>>
>>>> description = 'PeerDevice'
>>>>
>>>> dependencies {
>>>>     compile project(':Concept')
>>>> }
>>>>
>>>> At the moment, I only feel confident using gradle from the CLI. So,
>>>> when I open a CLI window within the CliqueSpace directory, and run "gradle
>>>> project PeerDevice", I get the following:
>>>>
>>>> owen@owen-Latitude-5511:~/Development/CliqueSpace/Code/trunk/CliqueSpace$
>>>> gradle project PeerDevice
>>>>
>>>> FAILURE: Build failed with an exception.
>>>>
>>>> * Where:
>>>> Build file
>>>> '/home/owen/Development/CliqueSpace/Code/trunk/CliqueSpace/PeerDevice/build.gradle'
>>>> line: 4
>>>>
>>>> * What went wrong:
>>>> A problem occurred evaluating project ':PeerDevice'.
>>>> > Could not find method compile() for arguments [project ':Concept'] on
>>>> object of type
>>>> org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
>>>>
>>>> * Try:
>>>> Run with --stacktrace option to get the stack trace. Run with --info or
>>>> --debug option to get more log output. Run with --scan to get full insights.
>>>>
>>>> * Get more help at https://help.gradle.org
>>>>
>>>> BUILD FAILED in 493ms
>>>>
>>>> In short, having followed the instructions from a few different sources
>>>> now, I don't know what I'm doing wrong. It might be good for the reader to
>>>> know that Concept/src/main/java has source code in it that compiles, but
>>>> PeerDevice/src/main/java also has source code where almost every Java
>>>> module has broken out in a rash of unresolved dependencies.
>>>>
>>>> Thanks for any help,
>>>>
>>>>   Owen.
>>>>
>>>

Re: Gradle won't resolve dependency: what's wrong here?

Posted by Owen Thomas <ow...@gmail.com>.
Hey Laszlo.

Sorry for not doing as you have asked, but while you were probably
composing your message, my Gradle project built!

I don't know if that means that I'm good - (it usually doesn't) I need to
add a lot more subprojects to the root project - but all I did was to
change CliqueSpace/PeerDevice/build.gradle from:

description = 'PeerDevice'

dependencies {
    *compile* project(':Concept')
}

to:
description = 'PeerDevice'

dependencies {
    *implementation* project(':Concept')
}

NetBeans is still telling me that the source code within the PeerDevice
project is not compiling. Perhaps there is a caching problem. (?)

I hope I'm on to something. If perhaps I'm not, then please let me know.
This might also give you more information about the problem I'm having and
equip you or others with more pointers.

  Owen.

On Tue, 2 Aug 2022 at 15:50, Laszlo Kishalmi <la...@gmail.com>
wrote:

> Well, I've done and see a few dozen of Gradle builds, though this sounds
> alien to me. If you could share your project structure (main folders and
> their build.gradle files, maybe we can help sort this thing out.
> On 8/1/22 22:39, Owen Thomas wrote:
>
> While I've been doing other things, I have come to the conclusion that I
> need something, possibly in my build.gradle file of the Concept project,
> that refers to the Groovy method "compile". Perhaps I will need to start
> here.
>
> On Tue, 2 Aug 2022 at 14:02, Jason Abreu <ja...@gmail.com> wrote:
>
>> When I converted about 30 projects from Any to Gradle, including multiple
>> multi-project builds, I noticed a few peculiar things.
>>
>> Firstly, NetBeans gets a background task hung up every now and then.  The
>> only solution for this was to exit NetBeans then find the hung up task and
>> kill it.  Once NetBeans restarted, the project scanning worked as expected
>> once more.
>>
>> Secondly, I have noticed that the Gradle dependency cache can get stale
>> and not refresh from repositories.  For this I would execute the Gradle
>> build task with the "--refresh-dependencies" (or something like that)
>> option to force Gradle to pull a fresh copy of the dependencies from the
>> repositories.
>>
>> Hope this helps!  I still consider myself new-ish to Gradle.  I do find
>> most of the support I need there in the NetBeans IDE for it, though.
>> However, my complaints about NetBeans relate to their lack of Jakarta EE 9
>> support, so far - but that's not anything to do with Gradle.
>>
>> --Jason
>>
>> On Mon, Aug 1, 2022, 22:59 Owen Thomas <ow...@gmail.com>
>> wrote:
>>
>>> Hello again. I am perplexed at the following problem.
>>>
>>> I have a multi-project build in a directory named "CliqueSpace". It's
>>> build.gradle file has the following:
>>>
>>> subprojects {
>>>     apply plugin: 'java'
>>>
>>>     repositories {
>>>         mavenCentral()
>>>     }
>>> }
>>>
>>> The settings.gradle file or the same directory has the following:
>>>
>>> rootProject.name = 'CliqueSpace'
>>>
>>> include ':Concept'
>>> include ':PeerDevice'
>>>
>>> There are other includes in the above file, but I don't think it is
>>> necessary to quote them here.
>>>
>>> In the Concept directory (CliqueSpace/Concept), build.gradle contains
>>> the following:
>>>
>>> description = 'Concept'
>>>
>>> In the PeerDevice directory (CliqueSpace/PeerDevice), build.gradle
>>> contains the following:
>>>
>>> description = 'PeerDevice'
>>>
>>> dependencies {
>>>     compile project(':Concept')
>>> }
>>>
>>> At the moment, I only feel confident using gradle from the CLI. So, when
>>> I open a CLI window within the CliqueSpace directory, and run "gradle
>>> project PeerDevice", I get the following:
>>>
>>> owen@owen-Latitude-5511:~/Development/CliqueSpace/Code/trunk/CliqueSpace$
>>> gradle project PeerDevice
>>>
>>> FAILURE: Build failed with an exception.
>>>
>>> * Where:
>>> Build file
>>> '/home/owen/Development/CliqueSpace/Code/trunk/CliqueSpace/PeerDevice/build.gradle'
>>> line: 4
>>>
>>> * What went wrong:
>>> A problem occurred evaluating project ':PeerDevice'.
>>> > Could not find method compile() for arguments [project ':Concept'] on
>>> object of type
>>> org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
>>>
>>> * Try:
>>> Run with --stacktrace option to get the stack trace. Run with --info or
>>> --debug option to get more log output. Run with --scan to get full insights.
>>>
>>> * Get more help at https://help.gradle.org
>>>
>>> BUILD FAILED in 493ms
>>>
>>> In short, having followed the instructions from a few different sources
>>> now, I don't know what I'm doing wrong. It might be good for the reader to
>>> know that Concept/src/main/java has source code in it that compiles, but
>>> PeerDevice/src/main/java also has source code where almost every Java
>>> module has broken out in a rash of unresolved dependencies.
>>>
>>> Thanks for any help,
>>>
>>>   Owen.
>>>
>>

Re: Gradle won't resolve dependency: what's wrong here?

Posted by Laszlo Kishalmi <la...@gmail.com>.
Well, I've done and see a few dozen of Gradle builds, though this sounds 
alien to me. If you could share your project structure (main folders and 
their build.gradle files, maybe we can help sort this thing out.

On 8/1/22 22:39, Owen Thomas wrote:
> While I've been doing other things, I have come to the conclusion that 
> I need something, possibly in my build.gradle file of the Concept 
> project, that refers to the Groovy method "compile". Perhaps I will 
> need to start here.
>
> On Tue, 2 Aug 2022 at 14:02, Jason Abreu <ja...@gmail.com> wrote:
>
>     When I converted about 30 projects from Any to Gradle, including
>     multiple multi-project builds, I noticed a few peculiar things.
>
>     Firstly, NetBeans gets a background task hung up every now and
>     then.  The only solution for this was to exit NetBeans then find
>     the hung up task and kill it.  Once NetBeans restarted, the
>     project scanning worked as expected once more.
>
>     Secondly, I have noticed that the Gradle dependency cache can get
>     stale and not refresh from repositories.  For this I would execute
>     the Gradle build task with the "--refresh-dependencies" (or
>     something like that) option to force Gradle to pull a fresh copy
>     of the dependencies from the repositories.
>
>     Hope this helps!  I still consider myself new-ish to Gradle.  I do
>     find most of the support I need there in the NetBeans IDE for it,
>     though.  However, my complaints about NetBeans relate to their
>     lack of Jakarta EE 9 support, so far - but that's not anything to
>     do with Gradle.
>
>     --Jason
>
>     On Mon, Aug 1, 2022, 22:59 Owen Thomas
>     <ow...@gmail.com> wrote:
>
>         Hello again. I am perplexed at the following problem.
>
>         I have a multi-project build in a directory named
>         "CliqueSpace". It's build.gradle file has the following:
>
>         subprojects {
>             apply plugin: 'java'
>
>             repositories {
>                 mavenCentral()
>             }
>         }
>
>         The settings.gradle file or the same directory has the following:
>
>         rootProject.name = 'CliqueSpace'
>
>         include ':Concept'
>         include ':PeerDevice'
>
>         There are other includes in the above file, but I don't think
>         it is necessary to quote them here.
>
>         In the Concept directory (CliqueSpace/Concept), build.gradle
>         contains the following:
>
>         description = 'Concept'
>
>         In the PeerDevice directory (CliqueSpace/PeerDevice),
>         build.gradle contains the following:
>
>         description = 'PeerDevice'
>
>         dependencies {
>             compile project(':Concept')
>         }
>
>         At the moment, I only feel confident using gradle from the
>         CLI. So, when I open a CLI window within the CliqueSpace
>         directory, and run "gradle project PeerDevice", I get the
>         following:
>
>         owen@owen-Latitude-5511:~/Development/CliqueSpace/Code/trunk/CliqueSpace$
>         gradle project PeerDevice
>
>         FAILURE: Build failed with an exception.
>
>         * Where:
>         Build file
>         '/home/owen/Development/CliqueSpace/Code/trunk/CliqueSpace/PeerDevice/build.gradle'
>         line: 4
>
>         * What went wrong:
>         A problem occurred evaluating project ':PeerDevice'.
>         > Could not find method compile() for arguments [project
>         ':Concept'] on object of type
>         org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
>
>         * Try:
>         Run with --stacktrace option to get the stack trace. Run with
>         --info or --debug option to get more log output. Run with
>         --scan to get full insights.
>
>         * Get more help at https://help.gradle.org
>
>         BUILD FAILED in 493ms
>
>         In short, having followed the instructions from a few
>         different sources now, I don't know what I'm doing wrong. It
>         might be good for the reader to know that
>         Concept/src/main/java has source code in it that compiles, but
>         PeerDevice/src/main/java also has source code where almost
>         every Java module has broken out in a rash of unresolved
>         dependencies.
>
>         Thanks for any help,
>
>           Owen.
>

Re: Gradle won't resolve dependency: what's wrong here?

Posted by Owen Thomas <ow...@gmail.com>.
While I've been doing other things, I have come to the conclusion that I
need something, possibly in my build.gradle file of the Concept project,
that refers to the Groovy method "compile". Perhaps I will need to start
here.

On Tue, 2 Aug 2022 at 14:02, Jason Abreu <ja...@gmail.com> wrote:

> When I converted about 30 projects from Any to Gradle, including multiple
> multi-project builds, I noticed a few peculiar things.
>
> Firstly, NetBeans gets a background task hung up every now and then.  The
> only solution for this was to exit NetBeans then find the hung up task and
> kill it.  Once NetBeans restarted, the project scanning worked as expected
> once more.
>
> Secondly, I have noticed that the Gradle dependency cache can get stale
> and not refresh from repositories.  For this I would execute the Gradle
> build task with the "--refresh-dependencies" (or something like that)
> option to force Gradle to pull a fresh copy of the dependencies from the
> repositories.
>
> Hope this helps!  I still consider myself new-ish to Gradle.  I do find
> most of the support I need there in the NetBeans IDE for it, though.
> However, my complaints about NetBeans relate to their lack of Jakarta EE 9
> support, so far - but that's not anything to do with Gradle.
>
> --Jason
>
> On Mon, Aug 1, 2022, 22:59 Owen Thomas <ow...@gmail.com> wrote:
>
>> Hello again. I am perplexed at the following problem.
>>
>> I have a multi-project build in a directory named "CliqueSpace". It's
>> build.gradle file has the following:
>>
>> subprojects {
>>     apply plugin: 'java'
>>
>>     repositories {
>>         mavenCentral()
>>     }
>> }
>>
>> The settings.gradle file or the same directory has the following:
>>
>> rootProject.name = 'CliqueSpace'
>>
>> include ':Concept'
>> include ':PeerDevice'
>>
>> There are other includes in the above file, but I don't think it is
>> necessary to quote them here.
>>
>> In the Concept directory (CliqueSpace/Concept), build.gradle contains the
>> following:
>>
>> description = 'Concept'
>>
>> In the PeerDevice directory (CliqueSpace/PeerDevice), build.gradle
>> contains the following:
>>
>> description = 'PeerDevice'
>>
>> dependencies {
>>     compile project(':Concept')
>> }
>>
>> At the moment, I only feel confident using gradle from the CLI. So, when
>> I open a CLI window within the CliqueSpace directory, and run "gradle
>> project PeerDevice", I get the following:
>>
>> owen@owen-Latitude-5511:~/Development/CliqueSpace/Code/trunk/CliqueSpace$
>> gradle project PeerDevice
>>
>> FAILURE: Build failed with an exception.
>>
>> * Where:
>> Build file
>> '/home/owen/Development/CliqueSpace/Code/trunk/CliqueSpace/PeerDevice/build.gradle'
>> line: 4
>>
>> * What went wrong:
>> A problem occurred evaluating project ':PeerDevice'.
>> > Could not find method compile() for arguments [project ':Concept'] on
>> object of type
>> org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
>>
>> * Try:
>> Run with --stacktrace option to get the stack trace. Run with --info or
>> --debug option to get more log output. Run with --scan to get full insights.
>>
>> * Get more help at https://help.gradle.org
>>
>> BUILD FAILED in 493ms
>>
>> In short, having followed the instructions from a few different sources
>> now, I don't know what I'm doing wrong. It might be good for the reader to
>> know that Concept/src/main/java has source code in it that compiles, but
>> PeerDevice/src/main/java also has source code where almost every Java
>> module has broken out in a rash of unresolved dependencies.
>>
>> Thanks for any help,
>>
>>   Owen.
>>
>

Re: Gradle won't resolve dependency: what's wrong here?

Posted by Jason Abreu <ja...@gmail.com>.
When I converted about 30 projects from Any to Gradle, including multiple
multi-project builds, I noticed a few peculiar things.

Firstly, NetBeans gets a background task hung up every now and then.  The
only solution for this was to exit NetBeans then find the hung up task and
kill it.  Once NetBeans restarted, the project scanning worked as expected
once more.

Secondly, I have noticed that the Gradle dependency cache can get stale and
not refresh from repositories.  For this I would execute the Gradle build
task with the "--refresh-dependencies" (or something like that) option to
force Gradle to pull a fresh copy of the dependencies from the repositories.

Hope this helps!  I still consider myself new-ish to Gradle.  I do find
most of the support I need there in the NetBeans IDE for it, though.
However, my complaints about NetBeans relate to their lack of Jakarta EE 9
support, so far - but that's not anything to do with Gradle.

--Jason

On Mon, Aug 1, 2022, 22:59 Owen Thomas <ow...@gmail.com> wrote:

> Hello again. I am perplexed at the following problem.
>
> I have a multi-project build in a directory named "CliqueSpace". It's
> build.gradle file has the following:
>
> subprojects {
>     apply plugin: 'java'
>
>     repositories {
>         mavenCentral()
>     }
> }
>
> The settings.gradle file or the same directory has the following:
>
> rootProject.name = 'CliqueSpace'
>
> include ':Concept'
> include ':PeerDevice'
>
> There are other includes in the above file, but I don't think it is
> necessary to quote them here.
>
> In the Concept directory (CliqueSpace/Concept), build.gradle contains the
> following:
>
> description = 'Concept'
>
> In the PeerDevice directory (CliqueSpace/PeerDevice), build.gradle
> contains the following:
>
> description = 'PeerDevice'
>
> dependencies {
>     compile project(':Concept')
> }
>
> At the moment, I only feel confident using gradle from the CLI. So, when I
> open a CLI window within the CliqueSpace directory, and run "gradle project
> PeerDevice", I get the following:
>
> owen@owen-Latitude-5511:~/Development/CliqueSpace/Code/trunk/CliqueSpace$
> gradle project PeerDevice
>
> FAILURE: Build failed with an exception.
>
> * Where:
> Build file
> '/home/owen/Development/CliqueSpace/Code/trunk/CliqueSpace/PeerDevice/build.gradle'
> line: 4
>
> * What went wrong:
> A problem occurred evaluating project ':PeerDevice'.
> > Could not find method compile() for arguments [project ':Concept'] on
> object of type
> org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
>
> * Try:
> Run with --stacktrace option to get the stack trace. Run with --info or
> --debug option to get more log output. Run with --scan to get full insights.
>
> * Get more help at https://help.gradle.org
>
> BUILD FAILED in 493ms
>
> In short, having followed the instructions from a few different sources
> now, I don't know what I'm doing wrong. It might be good for the reader to
> know that Concept/src/main/java has source code in it that compiles, but
> PeerDevice/src/main/java also has source code where almost every Java
> module has broken out in a rash of unresolved dependencies.
>
> Thanks for any help,
>
>   Owen.
>

Re: Gradle won't resolve dependency: what's wrong here?

Posted by Andreas Reichel <an...@manticore-projects.com>.
Hi Owen.

On Tue, 2022-08-02 at 13:46 +1000, Owen Thomas wrote:
> Thanks again Andreas; I hope someone can tell me what Gradle wants to
> hear. If perhaps you can help me show me how to get my projects to
> work in IntelliJ, then I would indeed be most thankful.

Can you share you Gradle file with me? Without any promise, I would
like to have a look at least.
I use fairly complex Sub-Projects with Gradle and got it working with
Gradle Command Line and IntelliJ -- but sub-projects keep failing with
Netbeans.

Cheers
Andreas


Re: Gradle won't resolve dependency: what's wrong here?

Posted by Owen Thomas <ow...@gmail.com>.
Hi Andreas.

In some way, I agree with you: NetBeans could make the conversion process
easier. Although I have only been trying to move my Ant projects to Gradle
now for probably little more than a day, I have also tried to use IntelliJ,
and their advice seems unable to solve the problem that I am having. The
solutions in IntelliJ I have read so far involve fiddling in an obscure
corner of the projects' settings, and they have not resolved my problem
either.

As I demonstrated, the problem appears to be with my Gradle project. I'm
using the CLI to issue commands to Gradle. The build is failing there, and
the solution to fix it seems to reside with telling Gradle what it wants to
hear.

Thanks again Andreas; I hope someone can tell me what Gradle wants to hear.
If perhaps you can help me show me how to get my projects to work in
IntelliJ, then I would indeed be most thankful.

  Owen.

On Tue, 2 Aug 2022 at 13:04, Andreas Reichel <an...@manticore-projects.com>
wrote:

> Owen, I have had the same problem and found only IntelliJ supporting
> Gradle Multi Projects properly. It made me switch.
>
> @Netbeans: I am really sorry to write that. I have used and loved Netbeans
> for my entire life. But not liking Maven (not at all!) and unable to stick
> with Ant, this is what it came to.
>
> On Tue, 2022-08-02 at 12:59 +1000, Owen Thomas wrote:
>
> Hello again. I am perplexed at the following problem.
>
> I have a multi-project build in a directory named "CliqueSpace". It's
> build.gradle file has the following:
>
> subprojects {
>     apply plugin: 'java'
>
>     repositories {
>         mavenCentral()
>     }
> }
>
> The settings.gradle file or the same directory has the following:
>
> rootProject.name = 'CliqueSpace'
>
> include ':Concept'
> include ':PeerDevice'
>
> There are other includes in the above file, but I don't think it is
> necessary to quote them here.
>
> In the Concept directory (CliqueSpace/Concept), build.gradle contains the
> following:
>
> description = 'Concept'
>
> In the PeerDevice directory (CliqueSpace/PeerDevice), build.gradle
> contains the following:
>
> description = 'PeerDevice'
>
> dependencies {
>     compile project(':Concept')
> }
>
> At the moment, I only feel confident using gradle from the CLI. So, when I
> open a CLI window within the CliqueSpace directory, and run "gradle project
> PeerDevice", I get the following:
>
> owen@owen-Latitude-5511:~/Development/CliqueSpace/Code/trunk/CliqueSpace$
> gradle project PeerDevice
>
> FAILURE: Build failed with an exception.
>
> * Where:
> Build file
> '/home/owen/Development/CliqueSpace/Code/trunk/CliqueSpace/PeerDevice/build.gradle'
> line: 4
>
> * What went wrong:
> A problem occurred evaluating project ':PeerDevice'.
> > Could not find method compile() for arguments [project ':Concept'] on
> object of type
> org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
>
> * Try:
> Run with --stacktrace option to get the stack trace. Run with --info or
> --debug option to get more log output. Run with --scan to get full insights.
>
> * Get more help at https://help.gradle.org
>
> BUILD FAILED in 493ms
>
> In short, having followed the instructions from a few different sources
> now, I don't know what I'm doing wrong. It might be good for the reader to
> know that Concept/src/main/java has source code in it that compiles, but
> PeerDevice/src/main/java also has source code where almost every Java
> module has broken out in a rash of unresolved dependencies.
>
> Thanks for any help,
>
>   Owen.
>
>
>

Re: Gradle won't resolve dependency: what's wrong here?

Posted by Andreas Reichel <an...@manticore-projects.com>.
Owen, I have had the same problem and found only IntelliJ supporting
Gradle Multi Projects properly. It made me switch.

@Netbeans: I am really sorry to write that. I have used and loved
Netbeans for my entire life. But not liking Maven (not at all!) and
unable to stick with Ant, this is what it came to.

On Tue, 2022-08-02 at 12:59 +1000, Owen Thomas wrote:
> Hello again. I am perplexed at the following problem.
> 
> I have a multi-project build in a directory named "CliqueSpace". It's
> build.gradle file has the following:
> 
> subprojects {
>     apply plugin: 'java'
> 
>     repositories {
>         mavenCentral()
>     }
> }
> 
> The settings.gradle file or the same directory has the following:
> 
> rootProject.name = 'CliqueSpace'
> 
> include ':Concept'
> include ':PeerDevice'
> 
> There are other includes in the above file, but I don't think it is
> necessary to quote them here.
> 
> In the Concept directory (CliqueSpace/Concept), build.gradle contains
> the following:
> 
> description = 'Concept'
> 
> In the PeerDevice directory (CliqueSpace/PeerDevice), build.gradle
> contains the following:
> 
> description = 'PeerDevice'
> 
> dependencies {
>     compile project(':Concept')
> }
> 
> At the moment, I only feel confident using gradle from the CLI. So,
> when I open a CLI window within the CliqueSpace directory, and run
> "gradle project PeerDevice", I get the following:
> 
> owen@owen-Latitude-
> 5511:~/Development/CliqueSpace/Code/trunk/CliqueSpace$ gradle project
> PeerDevice
> 
> FAILURE: Build failed with an exception.
> 
> * Where:
> Build file
> '/home/owen/Development/CliqueSpace/Code/trunk/CliqueSpace/PeerDevice
> /build.gradle' line: 4
> 
> * What went wrong:
> A problem occurred evaluating project ':PeerDevice'.
> > Could not find method compile() for arguments [project ':Concept']
> on object of type
> org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyH
> andler.
> 
> * Try:
> Run with --stacktrace option to get the stack trace. Run with --info
> or --debug option to get more log output. Run with --scan to get full
> insights.
> 
> * Get more help at https://help.gradle.org
> 
> BUILD FAILED in 493ms
> 
> In short, having followed the instructions from a few different
> sources now, I don't know what I'm doing wrong. It might be good for
> the reader to know that Concept/src/main/java has source code in it
> that compiles, but PeerDevice/src/main/java also has source code
> where almost every Java module has broken out in a rash of unresolved
> dependencies.
> 
> Thanks for any help,
> 
>   Owen.