Can I include a file from within a jar to be deployed with a web artifact?

已回答

In IDEA, I have created a Web module for a Tomcat service. I have created an artifact of type "Web Application Exploded" that includes my module. We have an XSD file that needs to be placed into a specific folder in the Output directory.

The problem is that the XSD file is in a jar file.

If you go to Project Structure -> Artifacts -> Output Layout tab, you can add a file, directory module, etc. and can specify where that will be deployed in the Output directory. I want to be able to select a file from within a jar to be deployed in the "Output directory". Is it possible? I don't see an option that would allow this.

To put it another way, this is what I have now:

I want to be able to click +, then find a jar file, then select a file from within that jar file. When Tomcat deploys the artifact, the individual file would be deployed to "classes" folder.

If not possible, is there some other way to accomplish getting the file deployed?

I am currently running Intellij IDEA Ultimate 2018.2.

0

It's not possible. You need to unpack the file from the jar first, then you can add it into the arbitrary artifact location.

0

请先登录再写评论。