[JIRA] (OSJ-349) Version.getVersion() does not work when using JPMS
Marcus Hert da Coregio (Jira)
jira at shibboleth.atlassian.net
Thu Jan 27 19:28:46 UTC 2022
Marcus Hert da Coregio ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A59830fca-3db6-4669-8c1e-b4b2c111a8e5 ) *created* an issue
OpenSAML - Java ( https://shibboleth.atlassian.net/browse/OSJ?atlOrigin=eyJpIjoiMTIxYzE3MjkxNDdhNGYwZTlhYTJjZjYzYzA3ODBiNTgiLCJwIjoiaiJ9 ) / Bug ( https://shibboleth.atlassian.net/browse/OSJ-349?atlOrigin=eyJpIjoiMTIxYzE3MjkxNDdhNGYwZTlhYTJjZjYzYzA3ODBiNTgiLCJwIjoiaiJ9 ) OSJ-349 ( https://shibboleth.atlassian.net/browse/OSJ-349?atlOrigin=eyJpIjoiMTIxYzE3MjkxNDdhNGYwZTlhYTJjZjYzYzA3ODBiNTgiLCJwIjoiaiJ9 ) Version.getVersion() does not work when using JPMS ( https://shibboleth.atlassian.net/browse/OSJ-349?atlOrigin=eyJpIjoiMTIxYzE3MjkxNDdhNGYwZTlhYTJjZjYzYzA3ODBiNTgiLCJwIjoiaiJ9 )
Issue Type: Bug Assignee: Brent Putman ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A97de0981-adc3-4044-95ed-131622fad81e ) Components: Core Classes Created: 27/Jan/22 2:28 PM Priority: Trivial Reporter: Marcus Hert da Coregio ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A59830fca-3db6-4669-8c1e-b4b2c111a8e5 )
When using the Version.getVersion() method to retrieve the OpenSAML version, it works well in most applications. However, when an application uses Java 9 Modules, the method returns null.
You can refer to this sample to simulate the problem: https://github.com/jzheaux/spring-security-examples/tree/with-modules-no-boot/with-modules.
Run the WithModulesApplication main class and see that null is printed to the console. If the module-info.java file gets removed, it prints the version correctly.
There is also another way to workaround this problem, that is doing like so Version.class.getModule().getDescriptor().version().get() , but since getModule() is a JDK 9 feature, this code does not compile with Java 8.
In Spring Security there are several places where we look for the OpenSAML version in order to decide which implementation to use. Having this sorted out would help us make the way that the version gets resolved more reliable.
( https://shibboleth.atlassian.net/browse/OSJ-349#add-comment?atlOrigin=eyJpIjoiMTIxYzE3MjkxNDdhNGYwZTlhYTJjZjYzYzA3ODBiNTgiLCJwIjoiaiJ9 ) Add Comment ( https://shibboleth.atlassian.net/browse/OSJ-349#add-comment?atlOrigin=eyJpIjoiMTIxYzE3MjkxNDdhNGYwZTlhYTJjZjYzYzA3ODBiNTgiLCJwIjoiaiJ9 )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100189- sha1:0bbbf41 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/commits/attachments/20220127/bbe34c83/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-comment-icon-87a7f934-bbda-4024-a4cf-a31c3bcaa62c
Type: image/png
Size: 1084 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220127/bbe34c83/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-trivial-98da6539-b3a2-4338-86c6-1cb9778e5b3c
Type: image/png
Size: 563 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220127/bbe34c83/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-avatar-8ccc6dfe-759a-4008-b6cc-0e303edd5819
Type: image/png
Size: 425 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220127/bbe34c83/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-footer-desktop-logo-5b3c3bfb-1298-4238-8fe8-6d5ec187cc2a
Type: image/png
Size: 10805 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220127/bbe34c83/attachment-0007.png>
More information about the commits
mailing list