Jamil
Jamil

Reputation: 2160

Automatically updating a JAR in Intellij IDEA

I have an android project in IDEA that uses external JAR. I have attached the source with the JAR using the File -> Project Structure. Now I can browse the class definitions however if I decide to modify a class belonging to the jar, how can I automatically compile the source and replace the jar with a new one ?

Upvotes: 4

Views: 6666

Answers (1)

CrazyCoder
CrazyCoder

Reputation: 402095

If you are going to change the classes inside the jar, you should consider configuring a separate Java module with the source code of this jar and make your main module depend on it.

This way you can easily modify code in this module and quickly build the final app containing the most recent changes.

If for some crazy reason it's not an option, then you should use Project Structure | Artifacts and set up a jar artifact and configure it to be built on Make, however with this approach you will still need a module with the source code which will be used as a source for this jar artifact, so I highly recommend to use the first way suggested above.

Upvotes: 7

Related Questions