Deploying extra file to web-inf/classes with tomcat integration

I am developing an application that is going to be deployed to Tomcat and am using IntelliJ's tomcat integration for local testing (BTW, this works great! It saves so much time letting IntelliJ take care of deploying/re-deploying the app after changes).

I have an extra property file that I need to read from the classpath, so I need to get this file into web-inf/classes. Nothing in the Web facet setup up (or deploy settings for tomcat) is jumping out at me as a way to tell IntelliJ to copy an arbitrary file to a certain location in the exploded directory (in this case web-inf/classes). Is this possible? (I take care of this via ANT for production and QA builds, just need to figure out how to get IntelliJ to do it for local development/testing).

I am using 7.0.1.

2 comments

Usually I put such resources into source folder. If the file extension matches the resource pattern defined
in Settings -> Compiler, then they are copied to classes folder.

You can also define an arbitrary file as a deployment descriptor:
Settings -> Project Settings -> Modules -> -> Web Facet -> Web Settings -> Deployment Descriptors -> Add... ->]]> Additional Resource
Then in "Additional Resource" select the file and in "Directory path relative to deployment root" enter "WEB-INF/classes".
What's very strange with this approach is that you'll never ever see that configured "Directory path relative to deployment root" again.
It isnot showed in the table of descriptors, nor in the dialog that you get when you press "Edit...":
http://www.jetbrains.net/jira/browse/IDEADEV-22623


Michael Parmeley wrote:

I am developing an application that is going to be deployed to Tomcat and am using IntelliJ's tomcat integration for local testing (BTW, this works great! It saves so much time letting IntelliJ take care of deploying/re-deploying the app after changes).

I have an extra property file that I need to read from the classpath, so I need to get this file into web-inf/classes. Nothing in the Web facet setup up (or deploy settings for tomcat) is jumping out at me as a way to tell IntelliJ to copy an arbitrary file to a certain location in the exploded directory (in this case web-inf/classes). Is this possible? (I take care of this via ANT for production and QA builds, just need to figure out how to get IntelliJ to do it for local development/testing).

I am using 7.0.1.

0

Thanks for this information! I just made sure my file had the ".properties" extension as that extension is configured by default as a resource by IntelliJ.

0

Please sign in to leave a comment.