kwin commented on a change in pull request #4:
URL: 
https://github.com/apache/sling-org-apache-sling-testing-sling-mock-oak/pull/4#discussion_r757933788



##########
File path: pom.xml
##########
@@ -180,7 +167,7 @@
                 <artifactId>maven-shade-plugin</artifactId>
                 <configuration>
                     <!--
-                        embed all jackrabbit artifacts to prevent classpath 
clashes
+                        embed all jackrabbit artifacts, to prevent classpath 
clashes

Review comment:
       Building aem-mock.core fails with
   ```
   [main] ERROR io.wcm.testing.mock.aem.context.ContextResourceResolverFactory 
- Failed initializing resource resolver factory, 
bundleContext=org.apache.sling.testing.mock.osgi.MockBundleContext@1704f67f
   java.lang.RuntimeException: Unable to invoke method 'activate' for class 
org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository
        at 
org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeMethod(OsgiServiceUtil.java:347)
        at 
org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeLifecycleMethod(OsgiServiceUtil.java:163)
        at 
org.apache.sling.testing.mock.osgi.OsgiServiceUtil.activateDeactivate(OsgiServiceUtil.java:98)
        at 
org.apache.sling.testing.mock.osgi.MockOsgi.registerInjectActivateService(MockOsgi.java:230)
        at 
org.apache.sling.testing.mock.osgi.MockOsgi.registerInjectActivateService(MockOsgi.java:247)
        at 
org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:197)
        at 
org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:183)
        at 
org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.setUp(ResourceResolverFactoryInitializer.java:69)
        at 
org.apache.sling.testing.mock.sling.MockSling.newResourceResolverFactory(MockSling.java:87)
        at 
io.wcm.testing.mock.aem.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:55)
        at 
io.wcm.testing.mock.aem.context.AemContextImpl.newResourceResolverFactory(AemContextImpl.java:99)
        at 
org.apache.sling.testing.mock.sling.context.SlingContextImpl.resourceResolverFactory(SlingContextImpl.java:151)
        at 
org.apache.sling.testing.mock.sling.context.SlingContextImpl.setUp(SlingContextImpl.java:135)
        at 
io.wcm.testing.mock.aem.context.AemContextImpl.setUp(AemContextImpl.java:104)
        at 
io.wcm.testing.mock.aem.junit.AemContext.access$400(AemContext.java:56)
        at 
io.wcm.testing.mock.aem.junit.AemContext$2.execute(AemContext.java:208)
        at 
io.wcm.testing.mock.aem.junit.AemContext$2.execute(AemContext.java:203)
        at 
io.wcm.testing.junit.rules.parameterized.RepeatedStatement.evaluate(RepeatedStatement.java:55)
        at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
        at 
org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
        at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
        at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
        at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:364)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:272)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:237)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:158)
        at 
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:428)
        at 
org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
        at 
org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:562)
        at 
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:548)
   Caused by: java.lang.IllegalStateException: Unexpected (too old) Oak version 
1.8.2, expected 1.40.0. Make sure to load the 
`org.apache.sling.testing.sling-mock-oak` dependency before any other 
dependency which may transitively depend on Apache Jackrabbit Oak as well!
        at 
org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository.activate(OakMockSlingRepository.java:89)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at 
org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeMethod(OsgiServiceUtil.java:338)
        ... 37 more
   ```
   
   This is IMHO expected as the order of dependencies prefers the old 1.8.2 
version due to the transitive dependencies of 
https://github.com/wcm-io/wcm-io-testing/blob/679d511e90214b4fa8a5a9d3d47a3f342461a1f8/aem-mock/core/pom.xml#L109
 (which is loaded prior to sling-mock-oak). I doubt that AEM mock really 
depends on Oak implementation classes and probably the dependency to oak-jcr 
should be reworked (with excludes) or alternatively put towards the end of the 
dependencies.




-- 
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]


Reply via email to