Use stand-alone weld-se-core dependency instead of an uber-jar weld-se #279
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
org.jboss.weld.se:weld-se
jar is an uber-jar that comes bundled with all its dependencies inside. I think it's better to use theweld-se-core
artifact as a dependency, and let Maven resolve the dependencies' versions.The problem is it can cause runtime exceptions when your project is using classes from different versions of dependencies that are bundled in the
weld-se
uber-jar. For me it was causingNoSuchMethod
exceptions when using Guava collections. I'm using Guava18.0
,weld-se
comes bundled with13.0.1
. The classes I've used were loaded from theweld-se
jar, even though there's an explicit Guava dependency in my project'spom.xml
.I can be completely, totally and utterly off base here:
Using the
weld-se-core
we can let Maven worry about the multiple versions of a dependency. The problem is that Maven will only pick one version of the dependency using the "nearest in the dependency tree" strategy. It did solve my problem, and left all CDI functioning properly, but it's possible it can cause the same problems for other users.For what it's worth, the
mvvmfx-cdi
test passed when run withweld-se-core:2.2.11.Final
andguava:18.0
as forced dependencies.