Missing non-Java files in deployment archive, bug or feature?

5
I just discovered that the MyBatis XML configuration files that lived between my Java sources don't survive the move to a deployment archive ;-) I understand that the 'resources' directory might be used for this purpose. However, this directory doesn't seem to be on the server classpath, which is needed by the MyBatis library to load relative configuration files automatically (i.e. I can't force the MyBatis library to use Core.getConfiguration().getResourcesPath()). NOTE: In my development environment everything runs smoothly. Meaning, my XML configuration files in the javasource directory get copied correctly to deployment/model/lib/bin. Is this a bug or a feature? I can't remember ever needing resources on the classpath like this before. Perhaps it only fails in 3.0.0-beta? I thought to post here first before submitting a ticket in the support portal. Kind regards, Jonathan van Alteren - FlowFabric
asked
2 answers
6

The solution to your problem is putting your XML configuration files in the userlib directory. The contents of this directory are copied to the deployment directory (and thus placed in deployment archives). Also, this directory is on the classpath, so you should be able to resolve the XML files.

answered
1

Could be something that wasn't foreseen yeah, I'd make a ticket for it. I guess you should be given the choice to include non-java files in the javasource folder when making a deployment archive.

As a workaround you can manually add them though, since it's just a zip file. Though if you're doing the deployment yourself you might as well put them in the right place.

answered