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.

8 comments
Comment actions Permalink

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.

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.

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

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


0
Comment actions Permalink

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.

0
Comment actions Permalink

Hello Charlie,

Thanks, Dmitry.

I will solve it manually then, for now.

Any chance that you could add this to a future release?


Yes, possibly. Could you please file a feature request at http://youtrack.jetbrains.net?

Thanks for all of your work on IntelliJ, by the way.  Great IDE.


Thanks for the kind words. :)

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


0
Comment actions Permalink

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.

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.

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



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

0
Comment actions Permalink

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)

0
Comment actions Permalink

Nikolay:

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.


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?

0
Comment actions Permalink

Yes, artifacts were introduced in IDEA 9.

Nikolay:

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.


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?

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



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

0
Comment actions Permalink

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

0

Please sign in to leave a comment.