Is it possible to force build before running external tool?

The title says it all. I'm using IDEA 5.0.1. The reason I ask is because I have resorted to running Tomcat as an external tool (see this post for the reason: http://www.intellij.net/forums/thread.jsp?forum=27&thread=168812) and when I change code I have to remember to do a 'make project' before running Tomcat as an external tool. I can't see any way of making this automatic - or am I missing something? It would be really nice if there was a tickbox on the external tool setup dialog that you could tick to get IDEA to make the module/project before the external tool is actually run, like there is on the runtime configuration setup dialog.

Tim.

7 comments

Why do you use virtual hosts? We have done some REALLY weird things to
Tomcat in the past, maybe I can help.

Tim Parish wrote:

The title says it all. I'm using IDEA 5.0.1. The reason I ask is because I have resorted to running Tomcat as an external tool (see this post for the reason: http://www.intellij.net/forums/thread.jsp?forum=27&thread=168812) and when I change code I have to remember to do a 'make project' before running Tomcat as an external tool. I can't see any way of making this automatic - or am I missing something? It would be really nice if there was a tickbox on the external tool setup dialog that you could tick to get IDEA to make the module/project before the external tool is actually run, like there is on the runtime configuration setup dialog.

>

Tim.

>

0

By looking at your thread, it looks like you are abusing TC like we were.

Let's take a look at your problems:

  • Running applications as the root ('/') context. This seems like a

good idea at first, but you REALLY need to move beyond that. We
did that for years. We were eventually forced (kicking and
screaming) to start running our webapps with their own unique
context. A better solution is to use Apache as your web server
and let it handle your oddities.
o You will need to wrap your URLs (images, css, .js, forwards,
etc) with c:url tags. It's a pain at first, but you will
adapt to it fairly easily.

  • It sounds like your libraries are not in each context's

/WEB-INF/lib directory. We used to have our libraries specified
in the system classpath, then beat TC with an ugly stick to make
it use that for EVERYTHING.
o Having your application conform to the standard layout will
reap tons of benefits. You can't imagine how good JSP
editing has become with IJ.

This is not intended to criticize or critic how you have your webapps
configured. We used to do the same thing.



Tim Parish wrote:

The title says it all. I'm using IDEA 5.0.1. The reason I ask is because I have resorted to running Tomcat as an external tool (see this post for the reason: http://www.intellij.net/forums/thread.jsp?forum=27&thread=168812) and when I change code I have to remember to do a 'make project' before running Tomcat as an external tool. I can't see any way of making this automatic - or am I missing something? It would be really nice if there was a tickbox on the external tool setup dialog that you could tick to get IDEA to make the module/project before the external tool is actually run, like there is on the runtime configuration setup dialog.

>

Tim.

>

0

Tim Parish wrote:

The title says it all. I'm using IDEA 5.0.1. The reason I ask is because I have resorted to running Tomcat as an external tool (see this post for the reason: http://www.intellij.net/forums/thread.jsp?forum=27&thread=168812) and when I change code I have to remember to do a 'make project' before running Tomcat as an external tool. I can't see any way of making this automatic - or am I missing something? It would be really nice if there was a tickbox on the external tool setup dialog that you could tick to get IDEA to make the module/project before the external tool is actually run, like there is on the runtime configuration setup dialog.

Tim.


I think the best idea would be to record a macro which runs make project, then
runs the tool.

0

Excellent, thankyou! I didn't even think of a macro - I've never used them before. I'll give that a go.

Tim.

0

Hi Norris,

Thanks for your replies. I've replied to your posts over in the original thread (http://www.intellij.net/forums/thread.jsp?forum=27&thread=168812)
to try and keep all the tomcat/virtual host discussion together in one place for anyone else who's following it or who comes across it later, and separate from this building-before-running-external-tool discussion. Hope that's ok. Maybe I shouldn't have started this thread, but I was worried that if I put it as a followup question on the other thread, it wouldn't be seen by anyone who had already discounted that thread due to getting bored with my rather long initial post there!

Thanks again,

Tim.

0

Fantastic, now I have a button on my toolbar which builds and then runs the external tool. What would be really nice would be if I could get IDEA to NOT run the tool if the build failed... but that seems a bit too hopeful - I can't see any way of doing that with a macro. Never mind, the macro is an improvement as it is.

Thanks again,

Tim.

0

Another option would perhaps be to use the "execute on" feature of the
ANT integration. This allows you to execute an ANT task after Make. With
the advantage that if the build fails, the ANT task is not executed (at
least I'm fairly certain of that).

Bas

0

Please sign in to leave a comment.