8

It it is possible generate an artifact with maven before a Tomcat Server Run/Debug Configuration of IntelliJ 13?

I have tried to do something like this, using Maven profiles, in order to build the system for Development, Preview and Production environments.

Any Thoughts?

Filipe
  • 1,189
  • 4
  • 15
  • 30

1 Answers1

25

To build a artifact with a profile you have to create a Maven Run/Debug configuration as in the following image

Maven Build

Then In Tomcat Run/Debug Configuration add above build in 'Before Launch' section by clicking the '+' button and select 'Run Another Configuration' then select the maven build.

Do Another Tool

The Result should like the below image.

Result

Now if you run Tomcat configuration first the maven build will be executed before Tomcat.

seenukarthi
  • 8,241
  • 10
  • 47
  • 68
  • 5
    thanks for the steps, but I actually had to use one more step where in tomcat run configuration I had to go to the deployment tab and select the .war file generated from the maven build – Anand Sunderraman Mar 10 '15 at 15:43
  • Your answer was instrumental to solving my problem on the same subject matter. However, there are a couple of things that have changed in IntelliJ currently, try to find time to update it. Thanks. – Olatunde Garuba Nov 30 '15 at 15:45
  • what does the "dev" mean? – JaskeyLam Mar 01 '16 at 11:13
  • @KarthikeyanVaithilingam , would you please simply explain how it works and if I am a very new beginner , do I need this param? – JaskeyLam Mar 01 '16 at 11:16
  • @Jaskey In maven pom.xml you can define profiles http://maven.apache.org/guides/introduction/introduction-to-profiles.html. each profile can have its own dependencies, plugins and so on.. when you run a maven command using a profile those dependencies will be included, plugins will be executed and so on. – seenukarthi Mar 01 '16 at 11:19