-
1. Re: as7 modules and cdi problem
ctomc Mar 21, 2012 6:13 PM (in response to herb)Hi,
by default all modules won't expose annotations.
to asure this, you have to explitly create jandex index of annotations and put it into your jar or pack it seperatly.
for more on how to do this take a look at jandex https://github.com/jbossas/jandex (there is also ant target to do that)
after you have created this index and put it into your jar or as extra resource to your modle.
you have to explisitly import annotations, so in your case you need in manifest entry like this:
Dependencies: com.mycompany annotations
hope it helps,
--
tomaz
-
2. Re: as7 modules and cdi problem
herb Mar 23, 2012 3:03 PM (in response to ctomc)Thank you for your reply - but it does not work for me
Maybe I missing something:
- I created a jandex.jar: <jandex run="true" newjar="true"><fileset dir="${deploy.dir}"/></jandex>
- I put "my.jar" and "my-jandex.jar" to modules directory
- I additionally added <resource-root path="my-jandex.jar"/> to module.xml
- I modified MANIFEST.MF dependencies: "Dependencies: mymodule export annotations" (I also tried without "export")
But I still get the above "WELD-001408 Unsatisfied dependencies"
Any suggestions?
herb
-
3. Re: as7 modules and cdi problem
ctomc Mar 23, 2012 6:09 PM (in response to herb)hi,
this should work, the only thing looking fishy is the jandex task, that <fileset dir="${deploy.dir}" there should be just your jar file and nothing else
you can run jandex manualy in command line
by running java -jar jandex.jar and it will give you all options, but in general you need just to create index for your jar file that has annotations.
--
tomaz