IntelliJ IDEA: Maven, compiling and deploying a project

Can someone explain to me the IntelliJ IDEA workflow of compiling, deploying, and packaging with the maven project attached?

I came across some misunderstanding when I start the tomcat server through IDEA debug mode. For example, I have one artifact - a military archive. As I understand it, when I start debugging mode - IDEA recompiles and updates the changed code in war-archive.

But what happens to the maven packed artifact? Does IntelliJ update it? Or do I need to set the "Buld maven before startup" option to make sure that the modified code is loaded into the environment?

+44
intellij-idea maven tomcat
Feb 24 '11 at 12:18
source share
2 answers

Intelli J does not use maven to create a project that uses its own build process. It uses the pom file as a project description.

This means a couple of things, if you want to create an artifact, such as a war file when working in tomcat, then you only need to tell IntelliJ to build a war in the Run / Debug Configurations dialog box. IntelliJ will automatically create any artifacts that you specify on the deployment tab of the run / debug configuration. Therefore, if you indicate a blown up war, it will build a blown up war, if you indicate a regular war, it will build a regular war.

Sometimes people need to run custom plugins or create goals, in which case you can configure IntelliJ to run maven custom goals.

You can also tell intellIJ to start the target of the maven package, rather than build an artifact. IntelliJ will deploy everything under the target directory for tomcat.

The important answer is that IntellIJ uses two separate build systems. You must tell each build system what to do. And you need to tell IntelliJ, who is building a system to use for what. IntelliJ will use its own build system by default after importing the project, unless you tell it to use maven for something.

While IntelliJ will build the artifact that you specify in the pom file, it will not do such things as expand their artifact repository (local or other wise) unless you click on the deployment target in the Maven tool window.

In addition, if you change your pom file and do not enable automatic re-import, these changes will not be reflected in your project until you click the force re-import option from the maven tool window.

+61
Apr 28 2018-11-11T00:
source share

I think you are looking for this.

Maven IDEA plugin

The IDEA plugin is used to create files (ipr, iml and iws) for the project, so you can work with it using the IDE, IntelliJ IDEA.

Hopes that help

-four
Apr 28 2018-11-11T00:
source share



All Articles