How to configure Intellij with inplace Tomcat deployment?

Hi, I would like to configure Intellij 12 for use inplace tomcat deployment.

I did not find any information to do that.

3 comments
Comment actions Permalink

Hello Alexandre,

When you say "inplace", I assume you mean a Tomcat instance that is already deployed somewhere. If so, you'll want to use the remote host deployment features of IntelliJ IDEA. Try taking a look at the following help guide documents.If you are running the Ultimate edition of IDEA, these same documents are available via the menu Help > Help Topics. If you are still have questions or run into any difficulties let us know.


http://www.jetbrains.com/idea/webhelp/remote-hosts.html  - and its children
http://www.jetbrains.com/idea/webhelp/deployment.html - and its children
http://www.jetbrains.com/idea/webhelp/run-debug-configuration-tomcat.html

Best Regards

0
Comment actions Permalink

Hi Mark, thank you for your help.

Unfortunately, it does not solve my question. When I said "inplace" I mean the ability to load resources from source folders and the compiled classes folder (instead of load them from build folder, it's much more faster because it does not require you to build or move directories).

Please take a look in http://blog.radaczynski.com/2012/12/webapp-development-stack-evolution-aka.html

How can I invoke the Maven goals "war:inplace tomcat:inplace" from Intellij?

Regards,
Alexandre

0
Comment actions Permalink

averri wrote:

How can I invoke the Maven goals "war:inplace tomcat:inplace" from Intellij?

OPTION 1
Define a maven run/debug configuration. This has the advantage of being the most configurable and usable with multiple goals.

OPTION 1 METHOD 1 (a bit quicker)

  1. Open the Maven tool window
  2. Expand the maven module and then its "Plugins"
  3. Expand the plugin or plugins whose goal(s) you want to run.
  4. Select the desired goal(s). Use the ctrl key to select multiple goals.
  5. Right click and select "Create [Module name] <goalNames>"
  6. Change the name if desired.
  7. Change any other configurations desired.
  8. Click OK.
  9. You can now run the configuration via the run toolbar or via Alt+Shift+F10 to open a popup listing all run configurations. You can also type Shift+F10 to run the run/debug configuration shown in the run toolbar bar.


You can also just define a Run/Debug configuration from scratch:

OPTION 1 METHOD 2

  1. Run > Edit Configurations (or select "Edit Configurations from the Run toolbar dropdown)
  2. Click the add icon (the plus sign)
  3. Select "Maven"
  4. Configure the maven configuration
  5. On the "Parameters" tab of the "Configuration" tab, enter the goals you want to run. For example: war:inplace tomcat:inplace
  6. Be sure not to forget the "working directory" setting. This is where IDE will look for the pom file
  7. Click OK.
  8. You can now run the configuration via the run toolbar or via Alt+Shift+F10 to open a popup listing all run configurations


You can define maven runner settings in File > Settings > [Project Settings] > Maven > Runner. These can be set/overridden in each run configuration. But it is easier to set here if you will use a consistent configuration.

Finally, you can modify the defaults for a new maven run/debug configuration by:

  1. Run > Edit Configurations (or select "Edit Configurations from the Run toolbar dropdown)
  2. Expand the "Defaults" node
  3. Select "maven"
  4. Set the desired defaults

These changes will only affect new run/debug configurations for the current project.


OPTION 2
Set a hot key to run the goal. The advantage is that it is always quick and easy to launch. With the above, you may need to key commands to launch. Not a big deal for most. But it is for some. The disadvantage is slightly reduced configuration ability and an inability to run multiple goals (to the best of my knowledge).

  1. File > Settings > [IDE Settings] > Keymap
  2. Expand the "Maven Goals" node
  3. Expand the maven module
  4. Select the desired goal. All plugin goals are shown.
  5. Map a hot key
  6. Click OK



For some more information on IntelliJ IDEA's maven integration, take a look at this screencast I recorded for some folks at my office a year or so ago.


I hope that helps.

0

Please sign in to leave a comment.