Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can IntelliJ zip my project source files after making the jar file?

I've updated File->Project Structure adding jar as an Artifact.

I noticed I can use a custom "Other" artifact to copy my whole project folder to another destination. Unfortunately they are not zipped at the destination, and I don't see how to make this happen.

How can I copy them into a zip file automatically, so when I am done I can upload the zip and jar off of my computer more easily, instead of manually zipping or uploading the directory recursively.

like image 383
700 Software Avatar asked Jul 01 '16 00:07

700 Software


People also ask

How do I zip a project in IntelliJ?

From the main menu, select File | Export | Project to Zip File. In the dialog that opens, specify the path to which you want to save the . zip file with the project and click Save.

How do I download source files in IntelliJ?

Download a file from the default deployment serverFrom the main menu, choose Tools | Deployment | Download from <default server>. IntelliJ IDEA will prompt you to overwrite local files, if any.

Where are jar files stored in IntelliJ?

File > Project Structure... or press Ctrl + Alt + Shift + S. Project Settings > Modules > Dependencies > "+" sign > JARs or directories... Select the jar file and click on OK, then click on another OK button to confirm. You can view the jar file in the "External Libraries" folder.


1 Answers

If you create a new Artifact of type Other. Then click the create the Archive button (it is next to the new directory button) and give it a name, project.zip for example. Right click the new zip entry under 'output root' and select 'add copy of' and then 'directory content'. Browse to your project directory and select it in the file picker. Click Apply and that should work.

It should look something like the screenshot below. Create zip archive. Now just build the Artifact in the usual way.

like image 131
Will Humphreys Avatar answered Oct 11 '22 15:10

Will Humphreys