Code Monkey home page Code Monkey logo

Comments (19)

AuroraLS3 avatar AuroraLS3 commented on June 20, 2024 1

Hi, how's it going?

from slimjar.

Vshnv avatar Vshnv commented on June 20, 2024

You can use ApplicationBuilder#internalRepositories.

Altho it is generally discouraged to use central directly for this purpose as all users downloading from central would take up more of their bandwidth, you could try hosting your own mirror.

from slimjar.

AnttiMK avatar AnttiMK commented on June 20, 2024

To be honest, bandwidth really shouldn't be an issue for a central repository using a global CDN (Fastly). I also wouldn't like to rely on a 3rd-party repository for reliability: if the repo is down, our plugin might fail to start.

Hosting our own mirror isn't really feasible budget-wise.

from slimjar.

Vshnv avatar Vshnv commented on June 20, 2024

Was just reiterating what was in the maven docs

from slimjar.

AuroraLS3 avatar AuroraLS3 commented on June 20, 2024

Using ApplicationBuilder#internalRepositories did the trick. Thanks!

from slimjar.

AuroraLS3 avatar AuroraLS3 commented on June 20, 2024

Hi, apparently the internal repositories method call does not stop calls to other repositories - what should I do? plan-player-analytics/Plan#2058

from slimjar.

Vshnv avatar Vshnv commented on June 20, 2024

Looking into this issue, will get back to you asap

from slimjar.

AuroraLS3 avatar AuroraLS3 commented on June 20, 2024

I tried to analyze the data flow but I ran into some trouble since the cache cuts off IntelliJ data flow analyzer.
Here's what I figured if it helps

  • ApplicationBuilder users SimpleDependencyInjectorFactory and then SimpleDependencyInjector
  • SimpleDependencyInjector creates an InjectionHelper with the paramters from ApplicationBuilder
  • InjectionHelper downloads dependencies using DependencyDownloader
  • InjectionHelpreFactory creates it with
         final DependencyResolver resolver = resolverFactory.create(repositories, preResolvedResults, enquirerFactory);
         final DependencyDownloader downloader = downloaderFactory.create(outputWriterFactory, resolver, verifier.create(resolver));
  • repositories comes from DependencyData
        public InjectionHelper create(final DependencyData data, final Map<String, ResolutionResult> preResolvedResults) throws IOException, NoSuchAlgorithmException, URISyntaxException {
        final Collection<Repository> repositories = mirrorSelector
                .select(data.getRepositories(), data.getMirrors());
  • Running data flow analyzer on DependencyData data has one constructed with
        new DependencyData(
                     Collections.emptySet(),
                     Collections.emptySet(),
                     Collections.emptySet(),
                     Collections.emptySet()
             );
    and others seem to come from cache by reading json. I don't unfortunately have enough knowledge about the project to continue the data flow analysis further from here. My best guess is the repositories given to mirrorSelector gets the default mirrors added in somewhere

from slimjar.

Vshnv avatar Vshnv commented on June 20, 2024

Hmm, what I was assuming is that this is due to the pre-resolution which doesnt not really have access to the ones declared in ApplicationBuilder#internalRepositories so it uses the default mirror for the pre-resolution stage.

from slimjar.

AuroraLS3 avatar AuroraLS3 commented on June 20, 2024

That would also make sense

from slimjar.

AnttiMK avatar AnttiMK commented on June 20, 2024

Hey @Vshnv, any ETA on this getting fixed?

from slimjar.

Vshnv avatar Vshnv commented on June 20, 2024

I'll try to get it fixed in a day or two

from slimjar.

Vshnv avatar Vshnv commented on June 20, 2024

Looking into this a bit, it shouldnt be using my repo as a mirror for compile-time resolution due to this commit f655afcdca63d093ce2190cf6fae13ec9d83449f.

What I can see from that is the issue is the resolver still having my repo in the all repos collection which makes it resolve a few dependencies on that. I'll try to figure out a way to overcome this.

from slimjar.

Vshnv avatar Vshnv commented on June 20, 2024

Switching this to a priority queue instead might work I guess (https://github.com/slimjar/slimjar/blob/master/slimjar/src/main/java/io/github/slimjar/resolver/CachingDependencyResolver.java#L45).

from slimjar.

AnttiMK avatar AnttiMK commented on June 20, 2024

I believe a PriorityQueue expects a class that implements Comparable<T>, so changing

.internalRepositories(Collections.singletonList(new Repository(new URL("https://papermc.io/repo/repository/maven-public/"))))

to

Queue<Repository> repositories = new PriorityQueue<>();
repositories.add(new Repository(new URL("https://papermc.io/repo/repository/maven-public/")));
// snip
.internalRepositories(repositories)

would throw a ClassCastException since Repository doesn't implement Comparable.

from slimjar.

Vshnv avatar Vshnv commented on June 20, 2024

Isnt there an alternative option of simply providing a comparator as the second parameter?

from slimjar.

AuroraLS3 avatar AuroraLS3 commented on June 20, 2024

Yes you can give a comparator as a paremeter to PriorityQueue constructor

from slimjar.

Vshnv avatar Vshnv commented on June 20, 2024

Alrighty, ill give that a shot to make sure central takes the highest priority in the collection

from slimjar.

AuroraLS3 avatar AuroraLS3 commented on June 20, 2024

Hi, what is the status on this? :)
I'm planning next release of my project in 2 weeks

Anything I can do to help?


We decided to go with a different solution for dependency downloading.

from slimjar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.