Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use stand-alone weld-se-core dependency instead of an uber-jar weld-se #279

Merged
merged 1 commit into from
Jul 6, 2015
Merged

Use stand-alone weld-se-core dependency instead of an uber-jar weld-se #279

merged 1 commit into from
Jul 6, 2015

Conversation

tomasz
Copy link
Contributor

@tomasz tomasz commented Jul 2, 2015

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 the weld-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 causing NoSuchMethod exceptions when using Guava collections. I'm using Guava 18.0, weld-se comes bundled with 13.0.1. The classes I've used were loaded from the weld-se jar, even though there's an explicit Guava dependency in my project's pom.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 with weld-se-core:2.2.11.Final and guava:18.0 as forced dependencies.

@manuel-mauky
Copy link
Collaborator

Thanks for your pull request.
I will test your change with some example projects within the next days.

@manuel-mauky
Copy link
Collaborator

After some testing I haven't found any problems with weld-se-core as dependency. Indeed it wasn't possible to use the latest guava version which was a suprise for me. I didn't know this problem with weld-se. Thanks for this advice.

manuel-mauky added a commit that referenced this pull request Jul 6, 2015
Use stand-alone weld-se-core dependency instead of an uber-jar weld-se
@manuel-mauky manuel-mauky merged commit 085b77f into sialcasa:develop Jul 6, 2015
@manuel-mauky manuel-mauky added this to the 1.4.0 milestone Jul 6, 2015
@tomasz
Copy link
Contributor Author

tomasz commented Jul 6, 2015

Glad I could help. 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants