-
Notifications
You must be signed in to change notification settings - Fork 23
analyse error: Artifact requires [aem-guides-wknd.core/0.0.6] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=11))" when compiled with Java 8 #15
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
Comments
Somehow the capabilities being calculated in https://github.com/apache/sling-org-apache-sling-feature-analyser/blob/master/src/main/java/org/apache/sling/feature/analyser/task/impl/CheckRequirementsCapabilities.java#L65 take the current java version as basis. Somehow one needs to override that. |
a workaround until this is fixed: it would be easier if the plugin would also support an "excludeTasks" option - but it does not. so we have to list all that are available and excluded that one that is problematic. here is another problems showing the same problem outlined by @kwin based on archetype 25: |
Probably one can use the parameter https://github.com/apache/sling-slingfeature-maven-plugin/blob/d8a0bffbe4d1715c9d0f8791bb4db74772d7e9ad/src/main/java/org/apache/sling/feature/maven/mojos/AnalyseFeaturesMojo.java#L73 to set the right execution environment. Not sure which artifact to reference here, though. |
I finally found the culprit and reported https://issues.apache.org/jira/browse/SLING-10288 for that. |
I think the best is if the target framework is already described as part of the SDK feature model. |
@rombert With SLING-10288 being implemented now, is there something we can do here? |
I can't with the project from the description as you now require Java 11 to run aemanalyser (
|
@kwin - so I guess the problem was solved in a different manner by requiring Java 11 so this situation can no longer occur? I would suggest to close this then. |
The general issue is that aemanalyser assumes the same Java version being used at build time (when executing the maven plugin) as during execution time of the OSGi runtime. The same would be true for building with Java 11 but running AEM in Java 17 (yes, I know, not yet supported). |
@kwin - can you try running the analysis on Java 11 and the latest AEM-CS SDK API with a project targetting Java 17 or Java 21 bytecode? |
Uh oh!
There was an error while loading. Please reload this page.
When you execute
mvn verify
on https://github.com/kwin/aem-analyser-example/tree/analyse-failure-with-java8 with Java 8 you getNo error is emitted with Java 11! The capability version of osgi.ee should not be derived from Java version of the Maven build but rather from the Java version AEM is running with (always 11 for AEMaaCS).
The text was updated successfully, but these errors were encountered: