The usability of the immutant.wildfly namespace and its contained vars depends on whether or not the application is actually deployed inside the container. If we are deployed on the container, you are injecting the org.immutant/wildfly (mvn) dependency. Yet this injection does not extend to compiling the project ahead of time.
Assume you have an application doing the following (src/iflyaot/core.clj):
With the following project.clj:
This will work fine when using the dev war deployment option of lein immutant war, because it avoids AOT. But if you try to compile the project, either explicitly (lein compile) or by producing an uberjar to include in the war (lein immutant war non-dev), you will stumble over an error such as:
This is a case where the user knows more than the environment. For AOTing something that we know is going to be deployed on a wildfly container, and where bits and pieces of immutant.wildfly are to be used, we need to explicitly add the org.immutant/wildfly dependency, i.e. add [org.immutant/wildfly "2.1.2"] to above sample's dependency vector in project.clj to fix the issue.
I suggest documenting this fact twofold:
- There is no mention of the availability of the org.immutant/wildfly package in the installation guide. Where it explains the individual contents of the org.immutant/immutant super package, I suggest adding mention of org.immutant/wildfly (and its current version) including a note "for wildfly deployments". Additionally the installation guide references the wildfly guide.
- The wildfly guide should detail the issue: explain the mechanic of the org.immutant/wildfly injection and how you can make this explicit if you're both only deploying on wildfly and using immutant.wildfly explicitly in your application
(in tcrawley's words: "if you are using something explicitly from the immutant.wildfly ns and need to AOT, you'll need to depend on it")