You may find reading this one useful:
https://docs.gradle.org/current/userguide/composite_builds.html

On Thu, Sep 22, 2022 at 7:43 AM Ernie Rael <e...@raelity.com> wrote:

> Thanks László,
>
> Since I got thing back in sync, have not seen the problem. I tried what
> I think were similar steps, it /did not reproduce/. Did not get into a
> situation where it seemed like I needed to nuke the on disk cache.
> Here's the steps, I see some things I'm not sure about, clarification on
> expectations would be great.
>
> Given two separate projects: app, lib. Where lib publishes to maven
> repository
>
>  1. put method "void XXX(String)" in lib
>     Publish lib local from console, access it from lib in IDE, build ok.
>  2. modify lib sig to "void XXX(int)", publish lib local to new version
>     from console
>  3. In app's buildSrc to reference new version. (but don't fix call to
>     XXX new arg type)
>     IDE shows no error, build app from IDE, build gets error
>  4. build lib in IDE, IDE still shows no error in app
>  5. change sig in app to call "XXX(int)"
>     IDE shows error, but IDE builds with no error
>  6. Close IDE, flush IDE cache, restart IDE
>     IDE shows no error, seems like flush cleared up problem in IDE cache
>
> So I could not reproduce a problem that required gradle cache cleanup.
> (though it seems I had reproducible steps that required IDE flush) I
> tried similar steps again, but instead in step 2, I used IDE to run
> action from navigator to publish lib to local maven, and IDE picked up
> the change and were consistent. So it seems like running stuff from
> console, isn't always picked up from the IDE. Was I hallucinating?
>
> Good to know about "Reload" project. If I see something peculiar, I can
> try that.
>
> I will stop using SNAPSHOTS, thanks. I guess the key is to turn off
> mavenLocal() to verify that I need to publish something :-)
>
> -ernie
>
> On 9/20/22 10:53 PM, László Kishalmi wrote:
> > I would say the on-disk cache is pretty stable by now, probably we
> > should remove that from being experimental.
> > I would check the project properties, the Sources section, and the
> > compile classpath section if that looks right.
> > You could check if reloading the project (right click on the project
> > node, the Reload) would help. That one would clear the cache and get a
> > fresh information from Gradle.
> > So, if that's not helping then, there is something else that the IDE
> > does not pick up.
> >
> > If the project could be disclosed, I could take a look.
> >
> > Hint: One of the bad things Maven introduced were the SNAPSHOT
> > versions. They created them as in the early days (probably pre 3.0)
> > the only way to reference dependencies between entities (sub projects
> > in Gradle term) of in a multi-pom projects was through the deployed
> > SNAPSHOT version of the library in the Local Maven repository. That's
> > gone now. SNAPSHOT versions should be avoided.
> >
> > On Tue, Sep 20, 2022 at 6:00 PM Ernie Rael <err...@raelity.com> wrote:
> >
> >     (Apologies if you see a duplicate)
> >
> >     Using NB-15, jdk-11
> >
> >     I have a library on MavenCentral (published from a gradle
> >     project), that
> >     I use in another project. I'm creating new version of that
> >     library. I'm
> >     into problems and peculiarities.
> >
> >     1. NetBeans remembered some method signatures that were not valid
> >     2. In debugger opened source from snapshot jar file, rather than from
> >         open file from open project
> >
> >     1 seemed like a clear error; found a dance that got rid of the
> >     problem,
> >     see below.
> >
> >     If 2 is correct, how can I set things up during dev/debug to get
> >     around it?
> >
> >     ** Some notes on 1. **
> >
> >     I've created a v1.1-SNAPSHOT and publishToMavenLocal.
> >
> >     I've got the following in BuildSrc in a project that uses the
> snapshot
> >
> >         repositories {
> >              mavenCentral()
> >              mavenLocal()
> >              // maven { url
> >         'https://oss.sonatype.org/content/repositories/snapshots/' }
> >         }
> >
> >     I use mavenLocal to access the snapshot..
> >
> >     In NetBeans, working on a project that uses the snapshot, although
> >     I can
> >     do a clean build, I had error indicators referring to some signatures
> >     that are not valid in the snapshot. I tried closing NetBeans and
> >     clearing it's cache, restart NetBeans. What finally worked (or at
> >     least
> >     seemed to be related) was toggling off
> >
> >         Tools > Options > Java > Gradle > Experimental > Use on-disk
> cache
> >
> >     followed by close NB, clear NB cache, restart NB. Perhaps a button:
> >     "clear NetBeans gradle cache" would be a better UI, at least until
> >     the
> >     cache is reliable. How flakey is the experimental use on-disk cache?
> >
> >     -ernie
> >
> >
> >     ---------------------------------------------------------------------
> >     To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
> >     For additional commands, e-mail: users-h...@netbeans.apache.org
> >
> >     For further information about the NetBeans mailing lists, visit:
> >     https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
>
>

Reply via email to