[
https://issues.apache.org/jira/browse/SLING-7312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16565479#comment-16565479
]
Stefan Seifert commented on SLING-7312:
---------------------------------------
executing this command on all sling repos:
{noformat}
find . -name "pom.xml" -exec fgrep -q "<artifactId>jsr305</artifactId>" {} ";"
-print
{noformat}
returned this list:
{noformat}
./org-apache-sling-api/pom.xml
./org-apache-sling-auth-core/pom.xml
./org-apache-sling-caconfig-api/pom.xml
./org-apache-sling-caconfig-impl/pom.xml
./org-apache-sling-caconfig-spi/pom.xml
./org-apache-sling-commons-clam/pom.xml
./org-apache-sling-commons-messaging/pom.xml
./org-apache-sling-commons-messaging-mail/pom.xml
./org-apache-sling-discovery-commons/pom.xml
./org-apache-sling-distribution-api/pom.xml
./org-apache-sling-distribution-avro-serializer/pom.xml
./org-apache-sling-distribution-core/pom.xml
./org-apache-sling-distribution-kryo-serializer/pom.xml
./org-apache-sling-installer-core/pom.xml
./org-apache-sling-jcr-api/pom.xml
./org-apache-sling-jcr-resource/pom.xml
./org-apache-sling-jms/pom.xml
./org-apache-sling-jobs/pom.xml
./org-apache-sling-jobs-it-services/pom.xml
./org-apache-sling-models-api/pom.xml
./org-apache-sling-models-impl/pom.xml
./org-apache-sling-models-jacksonexporter/pom.xml
./org-apache-sling-models-validation-impl/pom.xml
./org-apache-sling-mom/pom.xml
./org-apache-sling-oak-restrictions/pom.xml
./org-apache-sling-resource-presence/pom.xml
./org-apache-sling-resourceresolver/pom.xml
./org-apache-sling-scripting-core/pom.xml
./org-apache-sling-scripting-sightly/pom.xml
./org-apache-sling-scripting-thymeleaf/pom.xml
./org-apache-sling-tracer/pom.xml
./org-apache-sling-validation-api/pom.xml
./org-apache-sling-validation-core/pom.xml
./org-apache-sling-validation-test-services/pom.xml
./org-apache-sling-xss/pom.xml
./parent/pom.xml
./whiteboard/encrypt/pom.xml
./whiteboard/project-archetype/src/main/resources/archetype-resources/pom.xml
./whiteboard/scripting-resolver/org-apache-sling-scripting-resolver/pom.xml
{noformat}
following [this
discussion|https://lists.apache.org/thread.html/44cac2f3c9454a308b70adb9c73a8e9a928d9c145a12f82f8a3a0ef1@%3Cdev.sling.apache.org%3E]
the recommended solution is to switch to jetbrains annotations. spotbugs has
license problems (see also discussion in JCR-4301).
[~reschke] prepared a shell script for converting the annotations in the java
sources attached to OAK-7511 (i've not tested it yet).
should we do a vote on the list to get a consensus to which annotations we
should migrate?
> Java 9 requires javax.annotation to be added to the classpath
> -------------------------------------------------------------
>
> Key: SLING-7312
> URL: https://issues.apache.org/jira/browse/SLING-7312
> Project: Sling
> Issue Type: Bug
> Components: Launchpad
> Reporter: Robert Munteanu
> Priority: Major
> Fix For: Starter 11
>
>
> When running on Java 9 post SLING-7186 startup fails due to the
> {{javax.annotation}} package no longer being exported by default, e.g.
> {noformat}org.osgi.framework.BundleException: Unable to resolve
> org.apache.sling.installer.core [2](R 2.0): missing requirement
> [org.apache.sling.installer.core [2](R 2.0)] osgi.wiring.package;
> (osgi.wiring.package=javax.annotation) Unresolved requirements:
> [[org.apache.sling.installer.core [2](R 2.0)] osgi.wiring.package;
> (osgi.wiring.package=javax.annotation)]
> at
> org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4149)
> at org.apache.felix.framework.Felix.startBundle(Felix.java:2119)
> at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1373)
> at
> org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
> at java.base/java.lang.Thread.run(Thread.java:844){noformat}
> The interesting part here is that the {{javax.annotation}} classes that are
> required - for instance {{javax.annotation.CheckForNull}} are _not_ part of
> the JDK-provided {{javax.annotation}} package, they must come from another
> jar. In fact, we don't have that Jar deployed in the starter, but instead the
> JDK provides:
> {noformat}
> Generated.class
> PostConstruct.class
> PreDestroy.class
> Resource.class
> Resources.class
> {noformat}
> In a sense, this is very close to the root cause of SLING-7135 - solving one
> might solve both but the symptoms are very different so raising it separately.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)