arlokan
arlokan

Reputation: 88

Problem deploying jar generated with Intellij

I'm working in a couple of REST API developed with the Spring framework (Spring-boot). My coworkers use the STS IDE to code but I prefer Intellij. The generated JARs are not equivalent in both IDEs.

Everything's perfect until I have to generate the jar to deploy. The Intellij generated jar doesn't work for deployment, but the STS generated jar does. So, I code in Intellij and have to generate the jar from STS, which is very tedious.

From STS, I generate the jar with a simple right click on the project, Run As -> Maven install. The jar size is (for one of the projects) 50.4 MB and it works perfectly when deployed to the server.

For Intellij, I've created an artifact like this

Artifact

The size of the generated jar is 52.7 MB and it doesn't work when deployed to server.

How can I get equivalent results with both IDEs? How can I check possible discrepancies between jars?

Upvotes: 0

Views: 363

Answers (1)

Sambit
Sambit

Reputation: 8011

If you are able to build the project using maven command mvn clean install and if you are able to run successfully, then you can also achieve the same thing in Intellij Idea. I provide below the way along with the screen shot.

  1. Click on Maven tab which is visible in the right side.
  2. Click on M icon and type the command or select the command from the drop down list.
  3. You can see the project build in the run console of Intellij Idea.

enter image description here

enter image description here

Once project build is successful, you can make right click on the project and click on "Show in Explorer" and you can find the jar file in the project/target directory.

Upvotes: 1

Related Questions