8000 analyse error: Artifact requires [aem-guides-wknd.core/0.0.6] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=11))" when compiled with Java 8 · Issue #15 · adobe/aemanalyser-maven-plugin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Open
kwin opened this issue Dec 3, 2020 · 11 comments

Comments

@kwin
Copy link
Contributor
kwin commented Dec 3, 2020

When you execute mvn verify on https://github.com/kwin/aem-analyser-example/tree/analyse-failure-with-java8 with Java 8 you get

[ERROR] com.adobe.aem.guides:aem-guides-wknd.core:0.0.6: Artifact com.adobe.aem.guides:aem-guides-wknd.core:0.0.6 requires [aem-guides-wknd.core/0.0.6] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=11))" in start level 20 but no artifact is providing a matching capability in this start level.
[ERROR] Analyser detected errors on feature 'biz.netcentric.aem:aem-analyser-example:slingosgifeature:aggregated-author.prod:0.0.1-SNAPSHOT'. See log output for error messages.

No 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).

@kwin
Copy link
Contributor Author
kwin commented Jan 8, 2021

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.

@stefanseifert
Copy link
Contributor

a workaround until this is fixed:
stefanseifert/aem-cloud-service-deployment-issues@3d0ac6c

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

@kwin
Copy link
Contributor Author
kwin commented Apr 9, 2021

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.

@kwin
Copy link
Contributor Author
kwin commented Apr 9, 2021

I finally found the culprit and reported https://issues.apache.org/jira/browse/SLING-10288 for that.

@cziegeler
Copy link
Contributor

I think the best is if the target framework is already described as part of the SDK feature model.

@cziegeler
Copy link
Contributor

@rombert With SLING-10288 being implemented now, is there something we can do here?

@rombert
Copy link
Contributor
rombert commented Jul 26, 2024

I think this will be fixed with #245 . @kwin - could you validate that the current master + that PR fix the problem you reported?

@kwin
Copy link
Contributor Author
kwin commented Jul 26, 2024

I can't with the project from the description as you now require Java 11 to run aemanalyser (

<project.java.version>11</project.java.version>
).

@rombert
Copy link
Contributor
rombert commented Aug 14, 2024

@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.

@kwin
Copy link
Contributor Author
kwin commented Aug 14, 2024

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).

@rombert
Copy link
Contributor
rombert commented Dec 23, 2024

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
0