Discussion:
metainf-services duplicate classes
Eugen Cepoi
2014-09-22 13:27:16 UTC
Permalink
Hi,

When using maven shade plugin with metainf-services there are warnings
about duplicate classes with jersey-common.
I am wondering why those classes have been copied? Are they exactly the
same?

Also, is metainf-services just a way to support backwards compatibility
with libs that relied on the service loader mechanism but is not anymore
the preferred way to provide implementations? In that case what is the
preferred way to provide "out of the box integration" with jersey now
(similar to what is being done with moxy)?

Thanks,

Eugen
Eugen Cepoi
2014-10-13 21:31:33 UTC
Permalink
Any news on that?
Hi Marek,
All classes from /org/glassfish/jersey/message/internal/ are duplicated, I
don't know if the code inside has some changes (and in fact it is part of
my question), basically we can find them in both jersey-common and
jersey-metainf-services.
I just double checked by downloading manually the jars from
http://mvnrepository.com/artifact/org.glassfish.jersey.ext/jersey-metainf-services/2.12
and
http://mvnrepository.com/artifact/org.glassfish.jersey.core/jersey-common/2.12
and confirm it.
Concerning my other question (pluging in components that are detected with
no action from the user) I found the interface AutoDiscoverable. So it
looks like the service loader mechanism still works (by default) for this
one, is it the preferred way to register components?
Thanks,
Eugen
Hi Eugen,
Do you have example of which classes are duplicate? Can you verify the
classes are actually duplicate in the jar (just to make sure the problem is
not in your maven config)?
Thanks,
Marek
Post by Eugen Cepoi
Hi,
When using maven shade plugin with metainf-services there are warnings
about duplicate classes with jersey-common.
Post by Eugen Cepoi
I am wondering why those classes have been copied? Are they exactly the
same?
Post by Eugen Cepoi
Also, is metainf-services just a way to support backwards compatibility
with libs that relied on the service loader mechanism but is not anymore
the preferred way to provide implementations? In that case what is the
preferred way to provide "out of the box integration" with jersey now
(similar to what is being done with moxy)?
Post by Eugen Cepoi
Thanks,
Eugen
Marek Potociar
2014-10-14 14:01:24 UTC
Permalink
It's a bug: https://java.net/jira/browse/JERSEY-2687
Will be fixed in the next release.

Thank you for pointing out the problem.

Marek
Post by Eugen Cepoi
Any news on that?
Hi Marek,
All classes from /org/glassfish/jersey/message/internal/ are duplicated, I don't know if the code inside has some changes (and in fact it is part of my question), basically we can find them in both jersey-common and jersey-metainf-services.
I just double checked by downloading manually the jars from http://mvnrepository.com/artifact/org.glassfish.jersey.ext/jersey-metainf-services/2.12 and http://mvnrepository.com/artifact/org.glassfish.jersey.core/jersey-common/2.12 and confirm it.
Concerning my other question (pluging in components that are detected with no action from the user) I found the interface AutoDiscoverable. So it looks like the service loader mechanism still works (by default) for this one, is it the preferred way to register components?
Thanks,
Eugen
Hi Eugen,
Do you have example of which classes are duplicate? Can you verify the classes are actually duplicate in the jar (just to make sure the problem is not in your maven config)?
Thanks,
Marek
Hi,
When using maven shade plugin with metainf-services there are warnings about duplicate classes with jersey-common.
I am wondering why those classes have been copied? Are they exactly the same?
Also, is metainf-services just a way to support backwards compatibility with libs that relied on the service loader mechanism but is not anymore the preferred way to provide implementations? In that case what is the preferred way to provide "out of the box integration" with jersey now (similar to what is being done with moxy)?
Thanks,
Eugen
Eugen Cepoi
2014-10-14 14:03:48 UTC
Permalink
Great, thanks.

Eugen
Post by Marek Potociar
It's a bug: https://java.net/jira/browse/JERSEY-2687
Will be fixed in the next release.
Thank you for pointing out the problem.
Marek
Any news on that?
Hi Marek,
All classes from /org/glassfish/jersey/message/internal/ are duplicated,
I don't know if the code inside has some changes (and in fact it is part of
my question), basically we can find them in both jersey-common and
jersey-metainf-services.
I just double checked by downloading manually the jars from
http://mvnrepository.com/artifact/org.glassfish.jersey.ext/jersey-metainf-services/2.12
and
http://mvnrepository.com/artifact/org.glassfish.jersey.core/jersey-common/2.12
and confirm it.
Concerning my other question (pluging in components that are detected
with no action from the user) I found the interface AutoDiscoverable. So it
looks like the service loader mechanism still works (by default) for this
one, is it the preferred way to register components?
Thanks,
Eugen
Hi Eugen,
Do you have example of which classes are duplicate? Can you verify the
classes are actually duplicate in the jar (just to make sure the problem is
not in your maven config)?
Thanks,
Marek
Post by Eugen Cepoi
Hi,
When using maven shade plugin with metainf-services there are warnings
about duplicate classes with jersey-common.
Post by Eugen Cepoi
I am wondering why those classes have been copied? Are they exactly
the same?
Post by Eugen Cepoi
Also, is metainf-services just a way to support backwards
compatibility with libs that relied on the service loader mechanism but is
not anymore the preferred way to provide implementations? In that case what
is the preferred way to provide "out of the box integration" with jersey
now (similar to what is being done with moxy)?
Post by Eugen Cepoi
Thanks,
Eugen
Loading...