Store many resource files in separate jar

My Mathematica plugin for IDEA contains a resource folder consisting of several thousand (small) html files. These files are the documentation to Mathematica functions. When I rebuild my project, the copying of so many files takes very long compared to the rest of the compilation process.

Is it possible to create a jar from these files (folder structure) which is then exported to the compilation output? The documentation does not change, so I don't need to edit these files. I already tried to create a new library witht ProjectStructure -> Libraries -> Add new Library and then add a new "Source" library. I added this then to the Dependencies in the Modules section. Unfortunately, this does not work. Has someone a hint how to create this jar (I used jar cf) and include it properly?




Adding a library looks irrelevant, however, I may miss something.

I think you basically need artifacts. Check Project Strucutre dialog / Artifacts section, and product documentation on that topic. Welcome to ask more specific questions when you've got the point.



Hi Alexander,

thanks for your reply.

Adding a library looks irrelevant, however, I may miss something.

I wanted to pack the resources into a jar because then, only one file is copied to the compile output. Currently, I have a resource folder reflecting my package layout. As you can see it contains a de.halirutan.mathematica.documentation package whose content (all 5000 files) is copied on every rebuild although the doc-files were automatically created and don't change

Screenshot from 2013-10-08 04:26:58.png

Therefore, I wanted a library or artifact which is not copied every time I make a rebuild (or if it is copied, then only one jar file).

I have looked at artifacts and indeed this seems to be what I want. However, I cannot get it working correctly because the artifact output is not found when I run the plugin. Maybe you can give me further help. Let's assume I have a working resource folder, but instead of marking it as Source in the project settings and copying it on every build, I want to use and artifact for that.

How would I do that?

(Note that when I change the output path of the artifact to out/production/.. it is removed when I Rebuild my project and I would have to build the artifact everytime like before the Resources)

Best regards

(PS: is there a particular reason, why I can see my uploaded image in the edit preview but not in the final post?)



instead of changing the artifact output path to out/production/... you can add the artifact jar as a library to your module. IDEA will suggest to
choose the category of jar (classes/sources/javadoc/...) by hand. If you choose 'classes' the jar will be added to the classpath when you start your

Nikolay Chashnikov
Software Developer
"Develop with pleasure!"


Thanks Nikolay,

now it works perfectly.

If you choose 'classes' the jar will be added to the classpath when you start your

That was, what I haven't thought of. I got confused that I have to mark the resources as Source in the IDEA properties and used it for the jar too which, of course, did not work.



Please sign in to leave a comment.