Maven sources missing / duplicate classes

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Maven sources missing / duplicate classes

Joerg Schoenfisch
Hi,

I encountered that Eclipse is not showing me the sources for classes that now reside in the 'lang' module. This is due to those classes being both in the core.jar and the lang.jar, however, only the lang-sources.jar contains the sources for it. Unfortunately, Eclipse picks the class files from the core.jar, leaving me without documentation.

Is it intended to duplicate those classes? Is it possible to then also duplicate the sources?

Best,
Joerg

signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Maven sources missing / duplicate classes

Emond Papegaaij
On woensdag 19 juli 2017 11:07:28 CEST Joerg Schoenfisch wrote:
> I encountered that Eclipse is not showing me the sources for classes that
> now reside in the 'lang' module. This is due to those classes being both in
> the core.jar and the lang.jar, however, only the lang-sources.jar contains
> the sources for it. Unfortunately, Eclipse picks the class files from the
> core.jar, leaving me without documentation.
>
> Is it intended to duplicate those classes? Is it possible to then also
> duplicate the sources?

We ran into this as well. Our maven projects are all verified with the maven-
enforcer-plugin with banDuplicateClasses. This is to prevent conflicting
classes on the classpath with larger applications. We had to exclude all shiro
packages from this check. Please remove the classes from shiro-core and rely
on maven's transitive dependencies.

Best regards,
Emond Papegaaij
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Maven sources missing / duplicate classes

Brian Demers
It is possible you have an explicit dependency for shiro-lang and shiro-core.  And shiro-core version is getting set to an earlier version by something during dependency resolution.
You should be able to figure it out by running 'mvn dependency:tree'.

On Wed, Jul 19, 2017 at 6:53 AM, Emond Papegaaij <[hidden email]> wrote:
On woensdag 19 juli 2017 11:07:28 CEST Joerg Schoenfisch wrote:
> I encountered that Eclipse is not showing me the sources for classes that
> now reside in the 'lang' module. This is due to those classes being both in
> the core.jar and the lang.jar, however, only the lang-sources.jar contains
> the sources for it. Unfortunately, Eclipse picks the class files from the
> core.jar, leaving me without documentation.
>
> Is it intended to duplicate those classes? Is it possible to then also
> duplicate the sources?

We ran into this as well. Our maven projects are all verified with the maven-
enforcer-plugin with banDuplicateClasses. This is to prevent conflicting
classes on the classpath with larger applications. We had to exclude all shiro
packages from this check. Please remove the classes from shiro-core and rely
on maven's transitive dependencies.

Best regards,
Emond Papegaaij

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Maven sources missing / duplicate classes

Joerg Schoenfisch
I looked into the jar files, and both shiro-lang-1.4.0 and shiro-core-1.4.0 contain the same classes for example in org.apache.shiro.codec.
To be sure I scanned the output of mvn dependency:tree and there is only ever version 1.4.0 occurring. AFAICT nothing else should have a dependency on Shiro.


> Am 19.07.2017 um 15:43 schrieb Brian Demers <[hidden email]>:
>
> It is possible you have an explicit dependency for shiro-lang and shiro-core.  And shiro-core version is getting set to an earlier version by something during dependency resolution.
> You should be able to figure it out by running 'mvn dependency:tree'.
>
> On Wed, Jul 19, 2017 at 6:53 AM, Emond Papegaaij <[hidden email]> wrote:
> On woensdag 19 juli 2017 11:07:28 CEST Joerg Schoenfisch wrote:
> > I encountered that Eclipse is not showing me the sources for classes that
> > now reside in the 'lang' module. This is due to those classes being both in
> > the core.jar and the lang.jar, however, only the lang-sources.jar contains
> > the sources for it. Unfortunately, Eclipse picks the class files from the
> > core.jar, leaving me without documentation.
> >
> > Is it intended to duplicate those classes? Is it possible to then also
> > duplicate the sources?
>
> We ran into this as well. Our maven projects are all verified with the maven-
> enforcer-plugin with banDuplicateClasses. This is to prevent conflicting
> classes on the classpath with larger applications. We had to exclude all shiro
> packages from this check. Please remove the classes from shiro-core and rely
> on maven's transitive dependencies.
>
> Best regards,
> Emond Papegaaij
>


signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Maven sources missing / duplicate classes

Emond Papegaaij
In reply to this post by Brian Demers
All shiro artifacts are resolved as 1.4.0. We are very strict at this. Our
maven-enforcer-plugin also checks for version conflicts. The problem is that,
for example, both shiro-core-1.4.0.jar and shiro-lang-1.4.0.jar contain
org.apache.shiro.codec.Base64 (and many more). At the same time shiro-core
declares a dependency on shiro-lang in its pom. This imports the same classes
twice into your project.

Best regards,
Emond

On woensdag 19 juli 2017 09:43:01 CEST Brian Demers wrote:

> It is possible you have an explicit dependency for shiro-lang and
> shiro-core.  And shiro-core version is getting set to an earlier version by
> something during dependency resolution.
> You should be able to figure it out by running 'mvn dependency:tree'.
>
> On Wed, Jul 19, 2017 at 6:53 AM, Emond Papegaaij <[hidden email]
> > wrote:
> >
> > On woensdag 19 juli 2017 11:07:28 CEST Joerg Schoenfisch wrote:
> > > I encountered that Eclipse is not showing me the sources for classes
> > > that
> > > now reside in the 'lang' module. This is due to those classes being both
> >
> > in
> >
> > > the core.jar and the lang.jar, however, only the lang-sources.jar
> >
> > contains
> >
> > > the sources for it. Unfortunately, Eclipse picks the class files from
> > > the
> > > core.jar, leaving me without documentation.
> > >
> > > Is it intended to duplicate those classes? Is it possible to then also
> > > duplicate the sources?
> >
> > We ran into this as well. Our maven projects are all verified with the
> > maven-
> > enforcer-plugin with banDuplicateClasses. This is to prevent conflicting
> > classes on the classpath with larger applications. We had to exclude all
> > shiro
> > packages from this check. Please remove the classes from shiro-core and
> > rely
> > on maven's transitive dependencies.
> >
> > Best regards,
> > Emond Papegaaij


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Maven sources missing / duplicate classes

Brian Demers
I see it now, I was assuming it was a dependency resolution issue. Thanks for reporting this!

It looks like this is caused by the 'org.apache.felix:maven-bundle-plugin'

It looks like we should be able to just adjust this plugin's config.

If any of the OSGI folks on the list want to chime in, that would be appreciated!


On Wed, Jul 19, 2017 at 9:52 AM, Emond Papegaaij <[hidden email]> wrote:
All shiro artifacts are resolved as 1.4.0. We are very strict at this. Our
maven-enforcer-plugin also checks for version conflicts. The problem is that,
for example, both shiro-core-1.4.0.jar and shiro-lang-1.4.0.jar contain
org.apache.shiro.codec.Base64 (and many more). At the same time shiro-core
declares a dependency on shiro-lang in its pom. This imports the same classes
twice into your project.

Best regards,
Emond

On woensdag 19 juli 2017 09:43:01 CEST Brian Demers wrote:
> It is possible you have an explicit dependency for shiro-lang and
> shiro-core.  And shiro-core version is getting set to an earlier version by
> something during dependency resolution.
> You should be able to figure it out by running 'mvn dependency:tree'.
>
> On Wed, Jul 19, 2017 at 6:53 AM, Emond Papegaaij <[hidden email]
> > wrote:
> >
> > On woensdag 19 juli 2017 11:07:28 CEST Joerg Schoenfisch wrote:
> > > I encountered that Eclipse is not showing me the sources for classes
> > > that
> > > now reside in the 'lang' module. This is due to those classes being both
> >
> > in
> >
> > > the core.jar and the lang.jar, however, only the lang-sources.jar
> >
> > contains
> >
> > > the sources for it. Unfortunately, Eclipse picks the class files from
> > > the
> > > core.jar, leaving me without documentation.
> > >
> > > Is it intended to duplicate those classes? Is it possible to then also
> > > duplicate the sources?
> >
> > We ran into this as well. Our maven projects are all verified with the
> > maven-
> > enforcer-plugin with banDuplicateClasses. This is to prevent conflicting
> > classes on the classpath with larger applications. We had to exclude all
> > shiro
> > packages from this check. Please remove the classes from shiro-core and
> > rely
> > on maven's transitive dependencies.
> >
> > Best regards,
> > Emond Papegaaij



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Maven sources missing / duplicate classes

Emond Papegaaij
I know for Wicket we recently switched to build artifacts of type bundle (see
https://issues.apache.org/jira/browse/WICKET-6402 ). Maybe you can get the
correct configuration from Wicket?

On woensdag 19 juli 2017 10:26:54 CEST Brian Demers wrote:

> I see it now, I was assuming it was a dependency resolution issue. Thanks
> for reporting this!
>
> It looks like this is caused by the 'org.apache.felix:maven-bundle-plugin'
> I've created https://issues.apache.org/jira/browse/SHIRO-632 to track this.
>
> It looks like we should be able to just adjust this plugin's config.
> https://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle
> -plugin-bnd.html#export-package
>
> If any of the OSGI folks on the list want to chime in, that would be
> appreciated!
>
>
> On Wed, Jul 19, 2017 at 9:52 AM, Emond Papegaaij <[hidden email]
> > wrote:
> >
> > All shiro artifacts are resolved as 1.4.0. We are very strict at this. Our
> > maven-enforcer-plugin also checks for version conflicts. The problem is
> > that,
> > for example, both shiro-core-1.4.0.jar and shiro-lang-1.4.0.jar contain
> > org.apache.shiro.codec.Base64 (and many more). At the same time shiro-core
> > declares a dependency on shiro-lang in its pom. This imports the same
> > classes
> > twice into your project.
> >
> > Best regards,
> > Emond
> >
> > On woensdag 19 juli 2017 09:43:01 CEST Brian Demers wrote:
> > > It is possible you have an explicit dependency for shiro-lang and
> > > shiro-core.  And shiro-core version is getting set to an earlier version
> >
> > by
> >
> > > something during dependency resolution.
> > > You should be able to figure it out by running 'mvn dependency:tree'.
> > >
> > > On Wed, Jul 19, 2017 at 6:53 AM, Emond Papegaaij <
> >
> > [hidden email]
> >
> > > > wrote:
> > > >
> > > > On woensdag 19 juli 2017 11:07:28 CEST Joerg Schoenfisch wrote:
> > > > > I encountered that Eclipse is not showing me the sources for classes
> > > > > that
> > > > > now reside in the 'lang' module. This is due to those classes being
> >
> > both
> >
> > > > in
> > > >
> > > > > the core.jar and the lang.jar, however, only the lang-sources.jar
> > > >
> > > > contains
> > > >
> > > > > the sources for it. Unfortunately, Eclipse picks the class files
> > > > > from
> > > > > the
> > > > > core.jar, leaving me without documentation.
> > > > >
> > > > > Is it intended to duplicate those classes? Is it possible to then
> >
> > also
> >
> > > > > duplicate the sources?
> > > >
> > > > We ran into this as well. Our maven projects are all verified with the
> > > > maven-
> > > > enforcer-plugin with banDuplicateClasses. This is to prevent
> >
> > conflicting
> >
> > > > classes on the classpath with larger applications. We had to exclude
> >
> > all
> >
> > > > shiro
> > > > packages from this check. Please remove the classes from shiro-core
> > > > and
> > > > rely
> > > > on maven's transitive dependencies.
> > > >
> > > > Best regards,
> > > > Emond Papegaaij


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Maven sources missing / duplicate classes

Les Hazlewood-2
In reply to this post by Emond Papegaaij
I'm probably missing something, but there are no duplicate classes
that I can find in the core and lang modules.  Can you please point
them out to us?

https://github.com/apache/shiro/

On Wed, Jul 19, 2017 at 6:53 AM, Emond Papegaaij
<[hidden email]> wrote:

> On woensdag 19 juli 2017 11:07:28 CEST Joerg Schoenfisch wrote:
>> I encountered that Eclipse is not showing me the sources for classes that
>> now reside in the 'lang' module. This is due to those classes being both in
>> the core.jar and the lang.jar, however, only the lang-sources.jar contains
>> the sources for it. Unfortunately, Eclipse picks the class files from the
>> core.jar, leaving me without documentation.
>>
>> Is it intended to duplicate those classes? Is it possible to then also
>> duplicate the sources?
>
> We ran into this as well. Our maven projects are all verified with the maven-
> enforcer-plugin with banDuplicateClasses. This is to prevent conflicting
> classes on the classpath with larger applications. We had to exclude all shiro
> packages from this check. Please remove the classes from shiro-core and rely
> on maven's transitive dependencies.
>
> Best regards,
> Emond Papegaaij
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Maven sources missing / duplicate classes

Les Hazlewood-2
Aw, bummer - my email client didn't update quickly enough to see the
most recent 6 replies before I sent my previous message.  Sorry for
the noise :'(

On Wed, Jul 19, 2017 at 10:55 AM, Les Hazlewood <[hidden email]> wrote:

> I'm probably missing something, but there are no duplicate classes
> that I can find in the core and lang modules.  Can you please point
> them out to us?
>
> https://github.com/apache/shiro/
>
> On Wed, Jul 19, 2017 at 6:53 AM, Emond Papegaaij
> <[hidden email]> wrote:
>> On woensdag 19 juli 2017 11:07:28 CEST Joerg Schoenfisch wrote:
>>> I encountered that Eclipse is not showing me the sources for classes that
>>> now reside in the 'lang' module. This is due to those classes being both in
>>> the core.jar and the lang.jar, however, only the lang-sources.jar contains
>>> the sources for it. Unfortunately, Eclipse picks the class files from the
>>> core.jar, leaving me without documentation.
>>>
>>> Is it intended to duplicate those classes? Is it possible to then also
>>> duplicate the sources?
>>
>> We ran into this as well. Our maven projects are all verified with the maven-
>> enforcer-plugin with banDuplicateClasses. This is to prevent conflicting
>> classes on the classpath with larger applications. We had to exclude all shiro
>> packages from this check. Please remove the classes from shiro-core and rely
>> on maven's transitive dependencies.
>>
>> Best regards,
>> Emond Papegaaij
Loading...