I disagree 100%. It is required for the main use of geode-core which is to
create a Cache. Client Cache is something that came later. If you want it a
dependency to be optional for Client Caches then please create a
geode-client module that generates a pom without this dependency or move
the dependency from geode-core to geode-gfsh and make the latter optional
for creation of Client Caches. This kind of thing is why Users consider
Geode difficult to use. Marking the dependency as optional in geode-core
without any of the changes necessary to make it truly optional is simply a
bug.
The geode-core pom should be considered the pom for Geode Cache, not Geode
Client Cache. If we want to have a separate module for clients which leaves
out certain dependencies then that would be one approach. Moving GFSH and
the spring-shell dependent code to another Geode module would also be
another approach that works. But simply crippling a pom so that one of the
main uses of Geode does not work out of box is a big no-no.
Creating a Cache in an application using maven dependencies (geode-core
specifically) is supported but broken because we flag spring-shell as
optional.
A User who creates a Cache in an application should not be forced to either
have JMX broken or explicitly add in spring-shell to their application's
dependencies.
10:31:55.168 [main] WARN o.a.g.d.i.InternalDistributedSystem -
org/springframework/shell/core/Parser
java.lang.NoClassDefFoundError: org/springframework/shell/core/Parser
at
org.apache.geode.management.internal.beans.MemberMBeanBridge.<init>(MemberMBeanBridge.java:333)
at
org.apache.geode.management.internal.beans.ManagementAdapter.handleCacheCreation(ManagementAdapter.java:144)
at
org.apache.geode.management.internal.beans.ManagementListener.handleEvent(ManagementListener.java:115)
at
org.apache.geode.distributed.internal.InternalDistributedSystem.notifyResourceEventListeners(InternalDistributedSystem.java:2201)
at
org.apache.geode.distributed.internal.InternalDistributedSystem.handleResourceEvent(InternalDistributedSystem.java:606)
at
org.apache.geode.internal.cache.GemFireCacheImpl.initialize(GemFireCacheImpl.java:1214)
at
org.apache.geode.internal.cache.GemFireCacheImpl.basicCreate(GemFireCacheImpl.java:799)
at
org.apache.geode.internal.cache.GemFireCacheImpl.create(GemFireCacheImpl.java:785)
at org.apache.geode.cache.CacheFactory.create(CacheFactory.java:176)
at org.apache.geode.cache.CacheFactory.create(CacheFactory.java:223)
at
io.github.kirklund.geode.GeodeApplicationIntegrationTest.setUp(GeodeApplicationIntegrationTest.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at
com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.ClassNotFoundException:
org.springframework.shell.core.Parser
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 34 common frames omitted
You can reproduce this bug by specifying geode-core as a dependency in
maven:
<dependency>
<groupId>org.apache.geode</groupId>
<artifactId>geode-core</artifactId>
<version>1.9.0-SNAPSHOT</version>
</dependency>
And then create a Cache:
cache = new CacheFactory().set(LOCATORS, "").create();
You will see the above warning get logged and Geode JMX will be broken.
On Thu, Dec 6, 2018 at 10:27 AM Jacob Barrett <[email protected]> wrote:
> It should be in the POM as optional.
>
> > On Dec 6, 2018, at 10:17 AM, Kirk Lund <[email protected]> wrote:
> >
> > Is the presence of "ext.optional = true" for spring-shell in
> > geode-core/build.gradle the reason it's missing from the geode-core maven
> > pom?
> >
> > compile('org.springframework.shell:spring-shell:' +
> > project.'spring-shell.version') {
> > exclude module: 'aopalliance'
> > exclude module: 'asm'
> > exclude module: 'cglib'
> > exclude module: 'guava'
> > exclude module: 'spring-aop'
> > exclude module: 'spring-context-support'
> > exclude module: 'spring-core'
> > *ext.optional = true*
> > }
> >
> >
> >> On Thu, Dec 6, 2018 at 10:12 AM Kirk Lund <[email protected]> wrote:
> >>
> >> The geode-core maven pom is missing "spring-shell" -- where can I go to
> >> add in "spring-shell" as a required dependency? That's the code or
> gradle
> >> or xml that I want to look at.
> >>
> >>> On Thu, Dec 6, 2018 at 9:57 AM Jacob Barrett <[email protected]>
> wrote:
> >>>
> >>> That file is only for testing that the contents are as expected. The
> POM
> >>> is generated from dependencies and transitive dependencies specified
> in the
> >>> various Gradle files.
> >>>
> >>>> On Dec 6, 2018, at 9:55 AM, Kirk Lund <[email protected]> wrote:
> >>>>
> >>>> Is this the only file controlling and testing the dependencies for the
> >>>> geode-core maven pom that we publish?
> >>>>
> >>>> geode-core/src/test/resources/expected-pom.xml
> >>>>
> >>>>> On Thu, Dec 6, 2018 at 9:52 AM Kirk Lund <[email protected]> wrote:
> >>>>>
> >>>>> Can someone please point me at the right place to review and alter
> >>>>> the dependencies for geode-core that are being published for its
> maven
> >>> pom?
> >>>>>
> >>>>> Also, are there any tests involving the dependencies of the
> geode-core
> >>>>> maven pom?
> >>>>>
> >>>
> >>
>