Is there an easy way to create a build jar of an entire module including single file dependencies (dtd, txt, etc) in Intellij?

Hi there,

I'm fairly new to IntelliJ, and this is my dillemma, any help very much appreciated:

I've created a simple standalone xml transformation application using Intellij. Now that I've finished the project I simply want to package the apllication up as a build jar to allow users to access the application from a shared drive.
The application depends upon xalan and a couple of logging jars, which I seem to be able to add fairly simply using the 'build jar' dialog.
However, there are a number of additional files that the application requires such as dtds and txt files which I cannot seem to add via this dialog.  I've tried a number of hack type methods like dragging and dropping the files to the ouput jar, but I'm really just going to confuse the path locations by doing this.
All I want is to right-click on the module and there to be an option effectively 'build entire module to build jar', but I'm unsure if this is currently possible in IntelliJ, and if so, how to achieve it.

I'd prefer not to have to mess around with ant build files as this seems fairly unneccesary for a small project such as this.

Any help much appreciated.  Fundamentally I just want the module I have created to be built in its entirety to an external project jar.

Thanks in advance.

2 comments
Comment actions Permalink

Hello Adam,

Make sure that all files you need to pack in the jar are under a module source
root and listed in Settings | Compiler | Resources.

I'm fairly new to IntelliJ, and this is my dillemma, any help very
much appreciated:

I've created a simple standalone xml transformation application using
Intellij. Now that I've finished the project I simply want to package
the apllication up as a build jar to allow users to access the
application from a shared drive.

The application depends upon xalan and a couple of logging jars, which
I seem to be able to add fairly simply using the 'build jar' dialog.

However, there are a number of additional files that the application
requires such as dtds and txt files which I cannot seem to add via
this dialog. I've tried a number of hack type methods like dragging
and dropping the files to the ouput jar, but I'm really just going to
confuse the path location

s by doing this.

All I want is to right-click on the module and there to be an option
effectively 'build entire module to build jar', but I'm unsure if this
is currently possible in IntelliJ, and if so, how to achieve it.

I'd prefer not to have to mess around with ant build files as this
seems fairly unneccesary for a small project such as this.

Any help much appreciated. Fundamentally I just want the module I
have created to be built in its entirety to an external project jar.

Thanks in advance. Adam.

---
Original message URL:
http://www.jetbrains.net/devnet/message/5231765#5231765

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Thanks Dmitry.....however, this is the crazy thing...some of the files my application depends on are not in the src folder of my application.  I know this is wrong but I am building on the shoulders of a previous application and at the mercy of Xalan.  Specifically when an xml is transformed using the Xalan engine, a dtd file is expected under the project root.  However, I have a feeling the Xalan library dependency isn't working correctly either.
I've gone down the route of adding logging messages everywhere, however, no error messages are returned which suggests a file or library dependency is not making sense to the application somewhere.
I changed over from eclipse to IntelliJ to avoid build issues because there are just so many variables in a build.
Am I right in saying that IntelliJ can't currently interpret the structure of a module and replicate the module architecture to an external build jar?  There is still quite a lot of configuration required?
A key advantage of IntelliJ over Eclipse is that, when establishing a project, IntelliJ establishes all application dependencies to remove the potential nightmare of configuration.  It would be great if this approach could be applied to a build process so a user could simple specify a location and name for a build jar, click a button and recieve an executable jar with all dependencies ready to go.  Is this possible?

Thanks for your previous help, and any other pointers you or anyone else may have would be greatly appreciated.

Thanks.  Adam

0

Please sign in to leave a comment.