<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Mar 20, 2017 at 10:56 AM John Ament <<a href="mailto:john.ament@spartasystems.com">john.ament@spartasystems.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr" class="gmail_msg">
<div id="m_-3287734946957300713divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif" dir="ltr" class="gmail_msg">
<p class="gmail_msg">For me, that still doesn't discover. The only thing I can think of is that the JAR that includes <span class="gmail_msg">StringSearchModelInterpolator may have a beans.xml (does it?)</span></p></div></div></blockquote><div>No. </div><div><br></div><div>I spoke with John off-list; wanted to shed more light on my setup.</div><div><br></div><div>I pushed a shaky incomplete version of what I'm doing here: <a href="https://github.com/ljnelson/microbean-maven-cdi/blob/master/src/main/java/org/microbean/maven/cdi/MavenExtension.java">https://github.com/ljnelson/microbean-maven-cdi/blob/master/src/main/java/org/microbean/maven/cdi/MavenExtension.java</a></div><div><br></div><div>The purpose of this frightening :-) extension is uninteresting for the subject under discussion here. Briefly, it does just enough Plexus annotation processing to be mildly dangerous and break things in cool ways, and no more.</div><div><br></div><div>The test method is here: <a href="https://github.com/ljnelson/microbean-maven-cdi/blob/master/src/test/java/org/microbean/maven/cdi/TestMavenExtension.java#L65-L70">https://github.com/ljnelson/microbean-maven-cdi/blob/master/src/test/java/org/microbean/maven/cdi/TestMavenExtension.java#L65-L70</a></div><div><br></div><div>Note in particular the main method is not in this project. It is in this one, which is a test-scoped dependency: <a href="https://github.com/ljnelson/microbean-main/blob/master/src/main/java/org/microbean/main/Main.java#L125-L134">https://github.com/ljnelson/microbean-main/blob/master/src/main/java/org/microbean/main/Main.java#L125-L134</a></div><div><br></div><div>That project's <font face="monospace">META-INF/beans.xml</font> has bean discovery set to <font face="monospace">none</font> (<a href="https://github.com/ljnelson/microbean-main/blob/master/src/main/resources/META-INF/beans.xml#L7">https://github.com/ljnelson/microbean-main/blob/master/src/main/resources/META-INF/beans.xml#L7</a>), since there are no beans in that bean archive (it houses only the main class). John indicated that this was likely the source of the problem:</div><div><br></div><div>"Ok, knowing that this is the setup helps out dramatically. If I had to guess, the case of having the beans.xml from the main set to none is what's causing this. I remember Martin mentioned some issues with SE originally when I pushing [<i>sic</i>] that by default we should do discovery. My guess is that Weld is seeing the beans.xml from the root component [microbean-main] and actually falling back to the CDI 1.0 discovery behavior."<br></div><div><br></div><div>This project's <font face="monospace">META-INF/beans.xml</font> has bean discovery of "<font face="monospace">annotated</font>" (<a href="https://github.com/ljnelson/microbean-maven-cdi/blob/master/src/main/resources/META-INF/beans.xml#L7">https://github.com/ljnelson/microbean-maven-cdi/blob/master/src/main/resources/META-INF/beans.xml#L7</a>), though I confess that's mostly because I just wanted to use the default behavior, not because I carefully considered whether that was something I should use here or not. In any event, I don't anticipate there being any classes in this project with bean-defining annotations on them, nor any other classes that I would want discovered automatically.</div><div><br></div><div>Perhaps I have misunderstood bean discovery: I thought that the discovery mode applied to the bean archive in question alone, not to an aggregate.</div><div><br></div><div>Best,</div><div>Laird</div></div></div>