how can I include java source fils in module jar files?
I would like to include my .java files in the same jar file as my .class files.
I cannot figure out how to do that in IntelliJ, which is very frustrating.
You CAN do it with, say, Maven: http://jira.codehaus.org/browse/MJAR-72
Thanks in advance for any suggestions.
请先登录再写评论。
Hello Charlie,
There is no such feature in IntelliJ. You can write an Ant build script to
package the .jar file the way you need.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Thanks, Dmitry.
I will solve it manually then, for now.
Any chance that you could add this to a future release?
Thanks for all of your work on IntelliJ, by the way. Great IDE.
Hello Charlie,
Yes, possibly. Could you please file a feature request at http://youtrack.jetbrains.net?
Thanks for the kind words. :)
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Actually you can do it. Open Project Structure dialog, select "Artifacts" item and add a new Jar artifact. Then press '+' button and select 'Module
Output' item to add class files to the jar, and press '+' button, select 'Directory content' item and choose your source directory to put java files
in the artifact. After that you can build the jar by using Build | Build Artifact menu item.
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
On Thu, 11 Feb 2010 20:13:46 MSK, Charlie Epps
<no_reply@jetbrains.com> wrote, quoted or indirectly quoted someone
who said :
>I would like to include my .java files in the same jar file as my .class files.
>
>I cannot figure out how to do that in IntelliJ, which is very frustrating.
>
>You CAN do it with, say, Maven: http://jira.codehaus.org/browse/MJAR-72
See http://mindprod.com/jgloss/ant.html
You will see examples of various file inclusions (resources) in my
various ant scripts.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Nothing has really happened until it has been recorded.
~ Virginia Woolf (born: 1882-01-25 died: 1941-03-28 at age: 59)
Nikolay:
Sounds intriguing.
I goto File -> Project Structure and a dialog pops up. Unfortunately, I think that I searched everywhere in the various items, and I do not see Artifacts anywhere.
Is this a version issue? I am using 8.1.3 (that's what the company has a license for...).
Or am I going blind?
Yes, artifacts were introduced in IDEA 9.
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Why don't you include the artifacts by default? Create 3 jars by default, one with executables, another with source, and another with JavaDoc. Just like we see whenever downloading libraries from Apache Commons etc. And turn on the "Build on make" checkbox.
Aren't these artifacts commonly wanted by nearly all programmers for nearly all projects? If an advanced programmer does not want these jars, she can always delete the settings in "Artifacts" panel.
--Basil Bourque