AFAIK, we do not write out any index at runtime. The indexes are generated at build time.
That is not jandex index but just index information about packages.
this is done first time module is accessed to speed up classloading
Thanks for your reply, jaikiran and tomaz.
to jaikiran: AFAIK, only maven-resource with jandex="true" in build.xml will generate *-jandex.jar at build time.
to tomaz: You are right! it's not about jandex. My bad.
My original intent is to put my properites files outside my ear application. After following the [article](https://community.jboss.org/wiki/HowToPutAnExternalFileInTheClasspath) ,i touch a folder 'myconf' in $JBOSS_HOME and create a new module and use relative path to refer to $JBOSS_HOME/myconf, it's ok for me to get properties file from code inside ear.
But it's a little bit wierd to see myconf.index generated aside myconf. What's in myconf folder are just some properties files, not jars. How can i tell jboss modules not to generate .index for my specific module?
Thanks to Tomaz, I now realize that this is a JBoss Modules feature where it writes out a index file (nothing to do with Jandex, by the way). JBoss Modules allows the usage of a system property to disable writing out these indexes and/or reading from the pre-existing indexes. But it's at the system level which means that it isn't applied per module. So if you disable it, then it gets disabled for all modules. I think it might be a good idea to open an enhancement in JBoss Modules JIRA https://issues.jboss.org/browse/MODULES asking for a way to be introduced for this to be done per module basis.
Thanks to jaikiran. I've opened an enhancement in JBoss Modules. https://issues.jboss.org/browse/MODULES-170
I think it can be done through adding an new attribute aside slot attribute in module.xml and a 'if condition' in code.
Hi, What is the system property to disable writing out the index?
The system property is "jboss.modules.write-indexes"
The tag of jboss-modules used in JBoss AS 7.2.0.Final is:
In 1.2.0.CR1, org.jboss.modules.ResourceLoaders:
WRITE_INDEXES = Boolean.parseBoolean(AccessController.doPrivileged(new PropertyReadAction("jboss.modules.write-indexes", "true")));
But from 1.2.0.Final on, org.jboss.modules.ResourceLoaders:
USE_INDEXES = Boolean.parseBoolean(AccessController.doPrivileged(new PropertyReadAction("jboss.modules.use-indexes", "false")));
WRITE_INDEXES = USE_INDEXES && Boolean.parseBoolean(AccessController.doPrivileged(new PropertyReadAction("jboss.modules.write-indexes", "false")));
As you can see, the default value of WRITE_INDEXES is changed from true to false. BTW, it's still at the system level as jaikiran said.
Thank you very much for the details!