Experiences wanted: producing a jar artifact

This is a follow-up to question Artifact layout, can't select "Inline artifact" for included jar files, which has not received any replies.  I'm hoping that the reason is that somehow, in creating my artifact (or setting my project settings), I unwittingly did something which people don't tend to do, and which is causing my problem, and that by asking people here to share how they create jar artifacts and set up projects, I will discover what it is.

To recap: I have a Java project which depends on two library files.  I need to package up the entire thing, with the jars inlined (such that on doing jar -tfv <filename> I see ALL the classes listed, including the ones in the two libraries), into a single jar file.  I can make an artifact, I can add the library files to the Output Layout pane, but I CANNOT, no matter what I do, I cannot get the "Inline Artifact" item in the context menu to be selectable (i.e. non-grey) when I right-click on one or other library file.

The thing is, making a jar which contains library files as well as the project code is NOT an unusual situation in the Java world!  So I figure there are lots of IntelliJ folks out there who have done what I need to do.  And I would really like to hear from you folks.

What project settings do you use?  (be specific, please )

And exactly how do you set up your jar artifacts?  (again, as many specific details as possible, please )

I'm developing with IntelliJ 9.0.2 Community Edition, on the Mac, so I'd be particularly interested to hear from folks with similar setups who are successfully doing what I need to do.

Grateful thanks in advance, folks.

2 comments
Comment actions Permalink

I think is is probably rare for someone to produce their deployable artifacts with an IDE. Most people will use a build system of some sort for that like ANT or Maven.

Personally I use ANT.

Do you have some reason you want to combine the 2 dependent libraries and your project's classes into a single jar?

0
Comment actions Permalink

Thanks...this is interesting.  Eclipse has this ability and I believe JBuilder also (although I can't even get a trail version of it to run on my Mac 10.6 machine so don't know for sure), so I just assumed it would be available in IntelliJ also.

The reason I need to do it is that to make a Mac application, you put all the classes into a single jar which is executed by a java application stub.  At least, that's the only way I know of doing it.

However, the fact is that I already had an ant script which makes Mac applications, I used it when I was developing in NetBeans (before it started randomly deleting class files after compilation....grrrrrrr), so I'm able to use that while I wait for the next version of IntelliJ, which apparently will have the ability to inline jars in an artifact.

Thanks again for your reply.  I guess I was wrong in assuming that there were huge numbers of people doing what I need to do!

0

Please sign in to leave a comment.