Creating a JAR with a TLD in meta-inf?
Hi,
I've got a project that has several modules, one of these is the core stuff and it's deployed automatically into the web modules as a Jar. That's fine and good, but it includes some tags and so I also have a taglib file. I can't see where to put it so that it will be built into the meta-inf directory of the jar (like the JSTL jars). Is there any way to do this?
At the moment I have to write an ANT script to copy the TLD file into each of the web modules. Of course I could just write an ANT script to build the jar, but that seems a shame since IntelliJ automatically builds and deploys the jar already.
Thanks in advance,
D
请先登录再写评论。
This may or may not be the right answer, but I handled this by moving the META-INF directory into the src directory. Now when I invoke the jar task, I get a META-INF with my tld files inside the jar file.
For all of it's sleekness, IDEA really lacks flexibility in the build department.
Hello Bradley,
That's what I used to do as well. What's wrong with this solution?
Hi Bradley,
I must be dim because I can't seem to make it work the way you suggest. I have a src directory which has all my source files in and so I created a META-INF directory in there (just under src) and put the TLD files in there (with nothing else).
I then rebuild everything (just using the IntelliJ rebuild project, not an ANT script) and in the classes directory there was no META-INF directory, would I have expected to see it?
I then went to the Build Jars menu option on the Build menu and asked it to build the jar, which it did, but no META-INF.
Aha!!! As I wrote this, I tried moving the META-INF directory into the classes directory and then it works.
I sort of think that this is a useful side effect rather than the way it's meant to be, but it'll do me fine.
Thanks both,
Denis
Be careful with that. If you do a clean rebuild, they will probably be deleted!
Nothing really, those files just don't seem like "source" files to me. I would have liked a way to specify that other files were to be included in the build like you can with a web module. I was sort of hoping that an intellij dude would correct me and tell me how they designed this to be handled.
Brad.
Hello Bradley,
>> That's what I used to do as well. What's wrong with this solution?
>>
Usually I have META-INF etc in /conf, and "real" sources in /src.
Both are marked as "source" folders, while staying neatly separated.
This also has the nice effect that I can navigate to it using Ctrl-Shift-N.
What part of the web module config are you referring to?
-tt