Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-6049

incorrect metatype annotations in CustomRestrictionProvider exercise

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.0, 1.8.0, 1.4.25, 1.6.18
    • Component/s: exercise
    • Labels:
      None

      Description

      We need to update maven-scr-plugin to work with Java 8.

      Like that:

      Index: oak-parent/pom.xml
      ===================================================================
      --- oak-parent/pom.xml  (revision 1790388)
      +++ oak-parent/pom.xml  (working copy)
      @@ -63,8 +63,8 @@
           <h2.version>1.4.194</h2.version>
           <findbugs.version>3.0.0</findbugs.version>
           <derby.version>10.12.1.1</derby.version>
      -    <java.version>1.7</java.version>
      -    <java.version.signature>java17</java.version.signature>
      +    <java.version>1.8</java.version>
      +    <java.version.signature>java18</java.version.signature>
      
          <!-- specifies on which fixture to run the integration testing tests.
             override in profiles or provide from command line to change behaviour. Provide
      @@ -238,7 +238,7 @@
               <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-scr-plugin</artifactId>
      -          <version>1.16.0</version>
      +          <version>1.24.0</version>
                 <executions>
                   <execution>
                     <id>generate-scr-scrdescriptor</id>
      

      Once we do that, the following declarations aren't accepted anymore:

      "Component is defined to generate metatype information, however no properties or only private properties have been defined; in case no properties or only private properties are wanted, consider to use 'metatype=false'"

      To fix this, we need:

      Index: oak-exercise/src/main/java/org/apache/jackrabbit/oak/security/authorization/restriction/CustomRestrictionProvider.java
      ===================================================================
      --- oak-exercise/src/main/java/org/apache/jackrabbit/oak/security/authorization/restriction/CustomRestrictionProvider.java      (revision 1790388)
      +++ oak-exercise/src/main/java/org/apache/jackrabbit/oak/security/authorization/restriction/CustomRestrictionProvider.java      (working copy)
      @@ -36,9 +36,9 @@
       import org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider;
      
       /**
      - * EXERCISE: complete the implemenation
      + * EXERCISE: complete the implementation
        */
      -@Component(metatype = true, policy = ConfigurationPolicy.REQUIRE)
      +@Component(policy = ConfigurationPolicy.REQUIRE)
       @Service({RestrictionProvider.class})
       public class CustomRestrictionProvider implements RestrictionProvider {
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                reschke Julian Reschke
                Reporter:
                reschke Julian Reschke
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: