Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-10174

Feature attribute "$schema": is read add Artifact Extension

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Feature Model
    • None

    Description

      I have a feature Json that uses the "$schema" Attribute for an better integration with eclipse json content assist and validation.

      {
      "$schema": ["local:../../../../Feature-1.0.0.schema.json",
      "bundles": [
        "org.apache.sling:org.apache.sling.api:2.20.0"
        ]
      }

      when running the `feature-maven-plugin` i got this exception because it tryed to read this attribute as an Extension, and by default all unnamed extensions are Artifact Type.

      [ERROR] Internal error: java.lang.RuntimeException: Unable to read feature /var/home/stbischof/dev/git/geckoFeatures/org.gecko.feature.gogo.ssh/src/main/features/feature.json: /var/home/stbischof/dev/git/geckoFeatures/org.gecko.feature.gogo.ssh/src/main/features/feature.json : Key artifact is not a valid artifact id : local:../../../../Feature-1.0.0.schema.json -> [Help 1]
      org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Unable to read feature /var/home/stbischof/dev/git/geckoFeatures/org.gecko.feature.gogo.ssh/src/main/features/feature.json
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:120)
      	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
      	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
      Caused by: java.lang.RuntimeException: Unable to read feature /var/home/stbischof/dev/git/geckoFeatures/org.gecko.feature.gogo.ssh/src/main/features/feature.json
      	at org.apache.sling.feature.maven.Preprocessor.readProjectFeatures(Preprocessor.java:330)
      	at org.apache.sling.feature.maven.Preprocessor.process(Preprocessor.java:145)
      	at org.apache.sling.feature.maven.Preprocessor.process(Preprocessor.java:110)
      	at org.apache.sling.feature.maven.mojos.DependencyLifecycleParticipant.afterProjectsRead(DependencyLifecycleParticipant.java:79)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:264)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
      	... 11 more
      Caused by: java.io.IOException: /var/home/stbischof/dev/git/geckoFeatures/org.gecko.feature.gogo.ssh/src/main/features/feature.json : Key artifact is not a valid artifact id : local:../../../../Feature-1.0.0.schema.json
      	at org.apache.sling.feature.io.json.FeatureJSONReader.checkTypeArtifactId(FeatureJSONReader.java:456)
      	at org.apache.sling.feature.io.json.FeatureJSONReader.readArtifacts(FeatureJSONReader.java:195)
      	at org.apache.sling.feature.io.json.FeatureJSONReader.readExtensions(FeatureJSONReader.java:364)
      	at org.apache.sling.feature.io.json.FeatureJSONReader.readFeature(FeatureJSONReader.java:709)
      	at org.apache.sling.feature.io.json.FeatureJSONReader.read(FeatureJSONReader.java:77)
      	at org.apache.sling.feature.maven.Preprocessor.readProjectFeatures(Preprocessor.java:314)
      	... 17 more
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            bischofs@jena.de Stefan Bischof
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: