Comments (19)
Hi, how's it going?
from slimjar.
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.
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.
Was just reiterating what was in the maven docs
from slimjar.
Using ApplicationBuilder#internalRepositories did the trick. Thanks!
from slimjar.
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.
Looking into this issue, will get back to you asap
from slimjar.
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
usersSimpleDependencyInjectorFactory
and thenSimpleDependencyInjector
SimpleDependencyInjector
creates anInjectionHelper
with the paramters fromApplicationBuilder
InjectionHelper
downloads dependencies usingDependencyDownloader
InjectionHelpreFactory
creates it withfinal DependencyResolver resolver = resolverFactory.create(repositories, preResolvedResults, enquirerFactory); final DependencyDownloader downloader = downloaderFactory.create(outputWriterFactory, resolver, verifier.create(resolver));
repositories
comes fromDependencyData
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 withand 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 somewherenew DependencyData( Collections.emptySet(), Collections.emptySet(), Collections.emptySet(), Collections.emptySet() );
from slimjar.
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.
That would also make sense
from slimjar.
Hey @Vshnv, any ETA on this getting fixed?
from slimjar.
I'll try to get it fixed in a day or two
from slimjar.
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.
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.
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.
Isnt there an alternative option of simply providing a comparator as the second parameter?
from slimjar.
Yes you can give a comparator as a paremeter to PriorityQueue constructor
from slimjar.
Alrighty, ill give that a shot to make sure central takes the highest priority in the collection
from slimjar.
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)
- VerifyingRelocationHelper - No data available HOT 2
- Download directory gets removed after dependencies are loaded HOT 9
- [Question/Suggestion] Redundant relocated jars HOT 1
- Skip download if already exists HOT 11
- Choose download location for SlimJar's own dependencies HOT 2
- Add the ability to provide own logger instance HOT 6
- Multi-module issue. HOT 7
- Add exclude feature to "slim" HOT 2
- Unexpected checksum behavior. HOT 1
- Can't inject dependencies HOT 11
- it would be good if you push the sources with javadocs of slimjar artifact to the repository
- sometimes slimjar task stucks HOT 1
- Project fails to build with Gradle plugin v1.2.2 HOT 2
- Package io.github.slimjar.app.builder does not exist HOT 1
- IllegalArgumentException: URI is not hierarchical
- SlimJar repository HOT 2
- Cannot resolve GSON HOT 11
- Accidental PR HOT 1
- Doesn't support downloading without the Content-Length header HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slimjar.