views:

2855

answers:

4

I have a project that contains a single module, and some dependencies. I'd like to create a jar, in a separate directory, that contains the compiled module. In addition, I'd like to have the dependencies present beside my module.

No matter how I twist IntelliJ's "build jar" process, the output of my module appears empty (besides a META-INF file).

A: 

Idea 8.1.3

Jar is ok, since there is compiled output in 'output' directory (project/out/production//)

I guess, you have to run 'make' before building jar

for dependencies just check "show library" and choose what you want.

Vugluskr
+1  A: 

You might want to take a look at Maven (http://maven.apache.org). You can use it either as the main build process for your application, or just to perform certain tasks through the Edit Configurations dialog. The process of creating a JAR of a module within Maven is fairly trivial, if you want it to include all the dependencies in a self-executable JAR that is trivial as well.

If you've never used Maven before then you want to read Better Builds With Maven. I've got a link to it on my blog: http://gary-rowe.com/agilestack/downloads/).

Gary Rowe
Maven is obviously overhead for a simple tasks like creating jar. Maybe Ant but not maven for sure.
Juriy
A: 

Ant and Maven are widely used. I prefer Ant, I feel it's more lightweight and you the developer are more in control. Some would suggest that's its downside :-)

Brian