rombert commented on PR #47:
URL:
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/47#issuecomment-2165453415
I think this is ready for review. I performed some manual tests in the
following way:
**Patched Sling Starter**
```patchdiff --git a/pom.xml b/pom.xml
index da6dfa7..9350d1c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -93,6 +93,13 @@
<artifactId>slingfeature-maven-plugin</artifactId>
<version>1.8.2</version>
<extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+
<artifactId>org.apache.sling.feature.analyser</artifactId>
+ <version>2.0.5-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
<configuration>
<replacePropertyVariables>asm.version,jackrabbit.version,groovy.version,oak.version,slf4j.version,composum.nodes.version,jackson.version</replacePropertyVariables>
<aggregates>
@@ -102,6 +109,7 @@
<filesInclude>oak/*.json</filesInclude>
<filesInclude>oak/persistence/oak_persistence_sns.json</filesInclude>
<filesInclude>app/*.json</filesInclude>
+
<filesInclude>metadata/metadata.json</filesInclude>
<title>Sling With Oak Segment NS
Persistence</title>
</aggregate>
<aggregate>
@@ -110,12 +118,14 @@
<filesInclude>oak/*.json</filesInclude>
<filesInclude>oak/persistence/oak_persistence_mongods.json</filesInclude>
<filesInclude>app/*.json</filesInclude>
+
<filesInclude>metadata/metadata.json</filesInclude>
<title>Sling With Oak Document NS Mongo
Persistence</title>
</aggregate>
<aggregate>
<classifier>nosample_base</classifier>
<filesInclude>*.json</filesInclude>
<filesInclude>oak/*.json</filesInclude>
+
<filesInclude>metadata/metadata.json</filesInclude>
<title>Sling With No Samples and No
Persistence</title>
</aggregate>
<aggregate>
diff --git a/src/main/features/base.json b/src/main/features/base.json
index 3ed7dfd..c2360c7 100644
--- a/src/main/features/base.json
+++ b/src/main/features/base.json
@@ -3,8 +3,9 @@
"execution-environment:JSON|false":{
"framework":{
"id":"org.apache.felix:org.apache.felix.framework:7.0.5"
- }
- },
+ },
+ "javaVersion": "21"
+ },
"bundles":[
{
"id":"org.owasp.encoder:encoder:1.2.3",
diff --git a/src/main/features/metadata/metadata.json
b/src/main/features/metadata/metadata.json
new file mode 100644
index 0000000..ba2927f
--- /dev/null
+++ b/src/main/features/metadata/metadata.json
@@ -0,0 +1,13 @@
+{
+ "analyser-metadata:JSON|true":
+ {
+ ".*" : {
+ "manifest": null,
+ "report": {
+ "error": false,
+ "warning": false
+ }
+ },
+ "system.bundle": { }
+ }
+}
\ No newline at end of file
```
This way we record the execution metadata
**Sample Sling bundle**
Configured a Sling bundle to output Java 17 bytecode
```xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
```
**Sample Sling Launcher**
Configured a Sling launcher to include the above bundle and to extend from
the Sling Starter, so that the system bundle metadata is read. The launcher
includes the above bundle, to make sure the checks work as expected.
1. When the Starter is built with Java 11 and the launcher is built with
Java 11, the build fails ( Artifact com.example:core:1.0-SNAPSHOT requires
[com.example.core/1.0.0.SNAPSHOT] osgi.ee;
filter:="(&(osgi.ee=JavaSE)(version=17))" in start level 20 but no artifact is
providing a matching capability in this start level. )
2. When the Starter is built with Java 17 or 21 and the launcher is built
with Java 11, the build passes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]