0 Replies Latest reply on Aug 26, 2013 8:35 AM by rosand86

    Forge Plugin @Inject

    rosand86

      Hi,

       

      I am developing forge plugins. Some of them have common methods, and I want to create common project for these methods.

      So I have a common project, and several plugin project. But when I want to @Inject a bean from common Project to a forge plugin project, it throws an exception:

      [INFO] BUILD SUCCESS

      [INFO] ------------------------------------------------------------------------

      [INFO] Total time: 3.470s

      [INFO] Finished at: Mon Aug 26 14:18:44 CEST 2013

      [INFO] Final Memory: 16M/221M

      [INFO] ------------------------------------------------------------------------

      ***INFO*** Installing plugin artifact.

      ***SUCCESS*** Installed from [auditPlugin] successfully.

      Wrote C:\/Users/user/.forge/plugins/org/company/auditPlugin/1.0.0-SNAPSHOT-89a7bdea-dcba-44de-aabf-232645c00cf0

      Wrote C:\/Users/user/.forge/plugins/plugins/org/company/auditPlugin/1.0.0-SNAPSHOT-89a7bdea-dcba-44de-aabf-232645c00cf0/auditPlugin.jar

      Wrote C:\/Users/user/.forge/plugins/plugins/org/company/auditPlugin/1.0.0-SNAPSHOT-89a7bdea-dcba-44de-aabf-232645c00cf0/module.xml

      Wrote C:\/Users/user/.forge/plugins/plugins/org/company/auditPlugin/dependencies/1.0.0-SNAPSHOT-89a7bdea-dcba-44de-aabf-232645c00cf0

      Wrote C:\/Users/user/.forge/plugins/plugins/org/company/auditPlugin/dependencies/1.0.0-SNAPSHOT-89a7bdea-dcba-44de-aabf-232645c00cf0/common-0.0.1-SNAPSHOT.jar

      Wrote C:\/Users/user/.forge/plugins/plugins/org/company/auditPlugin/dependencies/1.0.0-SNAPSHOT-89a7bdea-dcba-44de-aabf-232645c00cf0/module.xml

      Plugin system disabled due to failure while loading one or more plugins; try removing offending plugins with "forge remove-plugin <TAB>".

      org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [ForgeGeneratorUtil] with qualifiers [@Default] at injection point [[parameter 1] of [constructor] @Inject public org.company.auditPlugin.DataAudit(ForgeGeneratorUtil)]

          at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:270)

          at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:106)

          at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:129)

          at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:351)

          at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:336)

          at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:404)

          at org.jboss.weld.environment.se.Weld.initialize(Weld.java:93)

          at org.jboss.forge.shell.Bootstrap$1.run(Bootstrap.java:140)

          at java.lang.Thread.run(Unknown Source)

       

      The maven compile is success, but installing plugin fails. What is the proper way for doing this? Should I use @Provider annotation or I have to use META-INF/services/javax.enterprise.inject.spi.Extension for making the service available from outeside? Injecting the org.jboss.seam.render.TemplateCompiler is possible, so there must be a working solution, but I can't understand this project.

       

      I have tried forge 1.2.2, 1.3.2 and 1.4.0. The result is the same.

       

      Can anybody please help?