3 ms·
In npm all packages have their own dependencies so specifying a specific version sort of works. In Maven for example the dependency tree is flattened by the pac
by molsson 9y ago
In npm all packages have their own dependencies so specifying a specific version sort of works. In Maven for example the dependency tree is flattened by the package manager so that at runtime there can only be a single version of libA. This is just how Java 8 and below works, you simply cannot import two versions of com.example.Foo at the same time. This will change in Java 9 with Jigsaw though. OSGi was a way to workaround this problem in <= Java 8. npm also has a "flattening" feature to save disk space but this is a completely different thing, an implementation detail that is never visible to the packages themselves.
- SanderMak 9y agoJust want to point out that Jigsaw/Java 9 will not support multiple versions out-of-the-box. (disclosure: I'm currently authoring Java 9 Modularity for O'Reilly)