[jira] [Commented] (MNG-6739) JSR 330 not picking up Guice Custom Bindings
[ https://issues.apache.org/jira/browse/MNG-6739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17420469#comment-17420469 ] Jose Montoya commented on MNG-6739: --- [~cstamas] thanks for your response. I actually gave up on the maven plugin idea I had because of this "issue" so I no longer have an investment in resolving this. I might suggest adding some of your explanation to have docs so maybe others don't fall to the same issue. Otherwise feel free to close this issue :) > JSR 330 not picking up Guice Custom Bindings > > > Key: MNG-6739 > URL: https://issues.apache.org/jira/browse/MNG-6739 > Project: Maven > Issue Type: Bug > Components: Plugins and Lifecycle >Affects Versions: 3.6.0 >Reporter: Jose Montoya >Priority: Major > Fix For: 4.0.x-candidate > > > See: https://maven.apache.org/maven-jsr330.html and > https://wiki.eclipse.org/Sisu/PlexusMigration > These docs state that Guice Modules annotated with {{@Named}} will be loaded > and configured automatically by Sisu. I think the actual loading is done by > {{org.eclipse.sisu.space.QualifiedTypeBinder}} but it only seems to work when > running tests via the {{maven-plugin-testing-harness}} and not when actually > running the plugin. > I've tried to add various different artifacts to compilation including > {{sisu.inject}}, {{sisu.inject.extender}} and {{plexus-container-default}} > but cannot get the Modules to be loaded, and consequently the Mojo fails to > instantiate with {{com.google.inject.ProvisionException: Unable to provision}} > I'm working on a simple project to reproduce, I'll update the ticket with a > link to it. If I can provide more information, or if I'm just missing > something simple please let me know. Thanks > EDIT: Here's the repo https://github.com/jam01/maven-plugin-jsr330-issue > {noformat} > mvn clean install > mvn com.jam01.test:printer-maven-plugin:print > {noformat} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (MNG-6739) JSR 330 not picking up Guice Custom Bindings
[ https://issues.apache.org/jira/browse/MNG-6739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17418537#comment-17418537 ] Tamás Cservenák commented on MNG-6739: -- [~jam01] Howdy, did you solve this issue? Just FTR let me list some facts: * the technique of custom bindings as in Sisu doco does work fine in "vanilla" SISU * but, Maven Plugin is not managed by "vanilla" Sisu container, it but in Maven container that creates complex hierarchical class-paths. * Maven does not export Guice to plugin class-path ("realm") as you figured * if you add Guice as direct dependency to plugin, it will most probably clash with core Guice (same class on two class-loaders) IF you manage your components within JSR330 container of (Sisu embedded in) Maven. * Hence, I'd say, if you really must have custom bindings within a maven plugin, you need to add all the dependencies (Guice), create a "bootstrap" that brings all your components up using "your" Guice instance, and then bridge it into Mojo (as injection into components managed by Maven SISU will not "see" these components, will not inject them). Anyway, these above are just tips. In any case (solved/unsolved) am expecting your response. > JSR 330 not picking up Guice Custom Bindings > > > Key: MNG-6739 > URL: https://issues.apache.org/jira/browse/MNG-6739 > Project: Maven > Issue Type: Bug > Components: Plugins and Lifecycle >Affects Versions: 3.6.0 >Reporter: Jose Montoya >Priority: Major > Fix For: 4.0.x-candidate > > > See: https://maven.apache.org/maven-jsr330.html and > https://wiki.eclipse.org/Sisu/PlexusMigration > These docs state that Guice Modules annotated with {{@Named}} will be loaded > and configured automatically by Sisu. I think the actual loading is done by > {{org.eclipse.sisu.space.QualifiedTypeBinder}} but it only seems to work when > running tests via the {{maven-plugin-testing-harness}} and not when actually > running the plugin. > I've tried to add various different artifacts to compilation including > {{sisu.inject}}, {{sisu.inject.extender}} and {{plexus-container-default}} > but cannot get the Modules to be loaded, and consequently the Mojo fails to > instantiate with {{com.google.inject.ProvisionException: Unable to provision}} > I'm working on a simple project to reproduce, I'll update the ticket with a > link to it. If I can provide more information, or if I'm just missing > something simple please let me know. Thanks > EDIT: Here's the repo https://github.com/jam01/maven-plugin-jsr330-issue > {noformat} > mvn clean install > mvn com.jam01.test:printer-maven-plugin:print > {noformat} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (MNG-6739) JSR 330 not picking up Guice Custom Bindings
[ https://issues.apache.org/jira/browse/MNG-6739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16910663#comment-16910663 ] Jose Montoya commented on MNG-6739: --- Seems to be a classloading issue, but I don't understand the {{Realm}} functionality to debug further > JSR 330 not picking up Guice Custom Bindings > > > Key: MNG-6739 > URL: https://issues.apache.org/jira/browse/MNG-6739 > Project: Maven > Issue Type: Bug > Components: Plugins and Lifecycle >Affects Versions: 3.6.0 >Reporter: Jose Montoya >Priority: Major > > See: https://maven.apache.org/maven-jsr330.html and > https://wiki.eclipse.org/Sisu/PlexusMigration > These docs state that Guice Modules annotated with {{@Named}} will be loaded > and configured automatically by Sisu. I think the actual loading is done by > {{org.eclipse.sisu.space.QualifiedTypeBinder}} but it only seems to work when > running tests via the {{maven-plugin-testing-harness}} and not when actually > running the plugin. > I've tried to add various different artifacts to compilation including > {{sisu.inject}}, {{sisu.inject.extender}} and {{plexus-container-default}} > but cannot get the Modules to be loaded, and consequently the Mojo fails to > instantiate with {{com.google.inject.ProvisionException: Unable to provision}} > I'm working on a simple project to reproduce, I'll update the ticket with a > link to it. If I can provide more information, or if I'm just missing > something simple please let me know. Thanks > EDIT: Here's the repo https://github.com/jam01/maven-plugin-jsr330-issue > {noformat} > mvn clean install > mvn com.jam01.test:printer-maven-plugin:print > {noformat} -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Commented] (MNG-6739) JSR 330 not picking up Guice Custom Bindings
[ https://issues.apache.org/jira/browse/MNG-6739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16910541#comment-16910541 ] Jose Montoya commented on MNG-6739: --- Explicitly declaring Guice as a dependency results in {noformat} [DEBUG] Populating class realm plugin>com.jam01.test:printer-maven-plugin:1.0-SNAPSHOT [DEBUG] Included: com.jam01.test:printer-maven-plugin:jar:1.0-SNAPSHOT [DEBUG] Included: com.google.inject:guice:jar:no_aop:4.2.1 [DEBUG] Included: aopalliance:aopalliance:jar:1.0 [DEBUG] Included: com.google.guava:guava:jar:25.1-android [DEBUG] Included: com.google.code.findbugs:jsr305:jar:3.0.2 [DEBUG] Included: org.checkerframework:checker-compat-qual:jar:2.0.0 [DEBUG] Included: com.google.errorprone:error_prone_annotations:jar:2.1.3 [DEBUG] Included: com.google.j2objc:j2objc-annotations:jar:1.1 [DEBUG] Included: org.codehaus.mojo:animal-sniffer-annotations:jar:1.14 [DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:1.1 {noformat} which allows the class to be loaded, but then when {{org.eclipse.sisu.space.QualifiedTypeBinder#hear}} checks if it's a module to be installed via {{Module.class.isAssignableFrom( qualifiedType )}} that incorrectly evaluates to {{false}} somehow. I don't understand why. The same expression evaluates to {{true}} from the test. > JSR 330 not picking up Guice Custom Bindings > > > Key: MNG-6739 > URL: https://issues.apache.org/jira/browse/MNG-6739 > Project: Maven > Issue Type: Bug > Components: Plugins and Lifecycle >Affects Versions: 3.6.0 >Reporter: Jose Montoya >Priority: Major > > See: https://maven.apache.org/maven-jsr330.html and > https://wiki.eclipse.org/Sisu/PlexusMigration > These docs state that Guice Modules annotated with {{@Named}} will be loaded > and configured automatically by Sisu. I think the actual loading is done by > {{org.eclipse.sisu.space.QualifiedTypeBinder}} but it only seems to work when > running tests via the {{maven-plugin-testing-harness}} and not when actually > running the plugin. > I've tried to add various different artifacts to compilation including > {{sisu.inject}}, {{sisu.inject.extender}} and {{plexus-container-default}} > but cannot get the Modules to be loaded, and consequently the Mojo fails to > instantiate with {{com.google.inject.ProvisionException: Unable to provision}} > I'm working on a simple project to reproduce, I'll update the ticket with a > link to it. If I can provide more information, or if I'm just missing > something simple please let me know. Thanks > EDIT: Here's the repo https://github.com/jam01/maven-plugin-jsr330-issue > {noformat} > mvn clean install > mvn com.jam01.test:printer-maven-plugin:print > {noformat} -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Commented] (MNG-6739) JSR 330 not picking up Guice Custom Bindings
[ https://issues.apache.org/jira/browse/MNG-6739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16910507#comment-16910507 ] Jose Montoya commented on MNG-6739: --- A little more debug suggests that the issue is that when org.eclipse.sisu.space.SpaceScanner#accept(org.eclipse.sisu.space.SpaceVisitor) fails when accepting the class because down the call stack org.eclipse.sisu.space.URLClassSpace#loadClass throws a TypeNotPresentException when trying to load com.google.inject.AbstractModule. I thiiink that's because of ``` [DEBUG] Importing foreign packages into class realm plugin>com.jam01.test:printer-maven-plugin:1.0-SNAPSHOT [DEBUG] Imported: < maven.api [DEBUG] Populating class realm plugin>com.jam01.test:printer-maven-plugin:1.0-SNAPSHOT [DEBUG] Included: com.jam01.test:printer-maven-plugin:jar:1.0-SNAPSHOT [DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:1.1 [DEBUG] Configuring mojo com.jam01.test:printer-maven-plugin:1.0-SNAPSHOT:print from plugin realm ClassRealm[plugin>com.jam01.test:printer-maven-plugin:1.0-SNAPSHOT, parent: sun.misc.Launcher$AppClassLoader@7852e922] ``` What I'm getting out of that message is that DefaultRealmManager(?) is not including the Guice libraries...? > JSR 330 not picking up Guice Custom Bindings > > > Key: MNG-6739 > URL: https://issues.apache.org/jira/browse/MNG-6739 > Project: Maven > Issue Type: Bug > Components: Plugins and Lifecycle >Affects Versions: 3.6.0 >Reporter: Jose Montoya >Priority: Major > > See: [https://maven.apache.org/maven-jsr330.html] and > [https://wiki.eclipse.org/Sisu/PlexusMigration] > These docs state that Guice Modules annotated with `@Named` will be loaded > and configured automatically by Sisu. I think the actual loading is done by > `org.eclipse.sisu.space.QualifiedTypeBinder` but it only seems to work when > running tests via the `maven-plugin-testing-harness` and not when actually > running the plugin. > I've tried to add various different artifacts to compilation including > `sisu.inject`, `sisu.inject.extender` and `plexus-container-default` but > cannot get the Modules to be loaded, and consequently the Mojo fails to > instantiate with com.google.inject.ProvisionException: Unable to provision. > I'm working on a simple project to reproduce, I'll update the ticket with a > link to it. If I can provide more information, or if I'm just missing > something simple please let me know. Thanks > EDIT: Here's the repo [https://github.com/jam01/maven-plugin-jsr330-issue] > ``` > mvn clean install > mvn com.jam01.test:printer-maven-plugin:print > ``` -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Commented] (MNG-6739) JSR 330 not picking up Guice Custom Bindings
[ https://issues.apache.org/jira/browse/MNG-6739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16910025#comment-16910025 ] Jose Montoya commented on MNG-6739: --- [~j...@kafsemo.org] I saw you were migrating maven-core from plexus to JSR 330. Sorry to pull you in, but thought maybe you could point me in the right direction? > JSR 330 not picking up Guice Custom Bindings > > > Key: MNG-6739 > URL: https://issues.apache.org/jira/browse/MNG-6739 > Project: Maven > Issue Type: Bug > Components: Plugins and Lifecycle >Affects Versions: 3.6.0 >Reporter: Jose Montoya >Priority: Major > > See: [https://maven.apache.org/maven-jsr330.html] and > [https://wiki.eclipse.org/Sisu/PlexusMigration] > These docs state that Guice Modules annotated with `@Named` will be loaded > and configured automatically by Sisu. I think the actual loading is done by > `org.eclipse.sisu.space.QualifiedTypeBinder` but it only seems to work when > running tests via the `maven-plugin-testing-harness` and not when actually > running the plugin. > I've tried to add various different artifacts to compilation including > `sisu.inject`, `sisu.inject.extender` and `plexus-container-default` but > cannot get the Modules to be loaded, and consequently the Mojo fails to > instantiate with com.google.inject.ProvisionException: Unable to provision. > I'm working on a simple project to reproduce, I'll update the ticket with a > link to it. If I can provide more information, or if I'm just missing > something simple please let me know. Thanks > EDIT: Here's the repo [https://github.com/jam01/maven-plugin-jsr330-issue] > ``` > mvn clean install > mvn com.jam01.test:printer-maven-plugin:print > ``` -- This message was sent by Atlassian JIRA (v7.6.14#76016)