Open kwin opened 3 years ago
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: https://github.com/stefanseifert/aem-cloud-service-deployment-issues/commit/3d0ac6c5583bb604c117a323968f79fe9d01c3b4
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: https://github.com/stefanseifert/aem-cloud-service-deployment-issues/tree/feature/archetype-25-java11
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 think this will be fixed with https://github.com/adobe/aemanalyser-maven-plugin/pull/245 . @kwin - could you validate that the current master + that PR fix the problem you reported?
I can't with the project from the description as you now require Java 11 to run aemanalyser (https://github.com/adobe/aemanalyser-maven-plugin/blob/d2df2a9ac36301a82a7a3887ee3b8eed7af903f0/parent-oss/pom.xml#L56).
@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).
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).