IDEA Artifacts and exploded jars

Hi,

I would like to know if it's possible to achieve the following in IDEA 9:

I have a Java project that obviously contains code and supporting jar libraries.  Let's call this project "HelloWorld". I would like to be able to produce a single artifact "HelloWorld.jar" that is an executable jar containing the compiled .class files AND all the contents of the jar dependencies (not the jar files themselves, but their exploded content) such that I can invoke this project by using "java -jar HelloWorld.jar" without the need of setting up a classpath or having additional jar files (libraries) in the filesystem.

I can get pretty close setting this up in IDEA but I cannot figure out how to tell IDEA to explode the JAR dependencies and include them in the artifact.

Thanks very much for any pointers.

--Boris

2 comments
Comment actions Permalink

Currently it isn't possible to include unpacked jars in an artifact. Feel free to create an issue for this feature
(http://youtrack.jetbrains.net/issues/IDEA).

Hi,

I would like to know if it's possible to achieve the following in IDEA 9:

I have a Java project that obviously contains code and supporting jar libraries.  Let's call this project "HelloWorld". I would like to be able to produce a single artifact "HelloWorld.jar" that is an executable jar containing the compiled .class files AND all the contents of the jar dependencies (not the jar files themselves, but their exploded content) such that I can invoke this project by using "java -jar HelloWorld.jar" without the need of setting up a classpath or having additional jar files (libraries) in the filesystem.

I can get pretty close setting this up in IDEA but I cannot figure out how to tell IDEA to explode the JAR dependencies and include them in the artifact.

Thanks very much for any pointers.

--Boris

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



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Boris has created an issue for this if you wish to vote  IDEA-51729

This affects us on a larger scale since we were using a kind of workaround when building our own application jars.

In Idea 8 we'd use EJB Facets to create our application jars and there was a section in the facet creation with our dependent jars automatically expanded.  This section is now removed in Idea 9.  The classpath would automatically be worked out.

An neat alternative though has been to write our own bash script to find jars in a library folder.  Instead of a jar artifact, try an 'other' artifact with a jar inside, and a seperate directory to the side where you can store your supported libs.

0

Please sign in to leave a comment.