What is the difference between $TOMCAT_HOME$ and $IDEA_RUN:TOMCAT_HOME$?

Our shared run configuration is constantly changing between

<STARTUP>         <option name="SCRIPT" value="$TOMCAT_HOME$/bin/catalina.sh" /> </STARTUP>



and

<STARTUP>         <option name="SCRIPT" value="%IDEA_RUN:TOMCAT_HOME%/bin/catalina.sh" /> </STARTUP>



This is annoying because we get changes in VCS, which aren't neccassery.

What is the difference between the path variable and the prefix with IDEA_RUN? How can we avoide these changes?
0
14 comments
Avatar
Permanently deleted user

$TOMCAT_HOME$ refers to a user-defined path variable (File | Settings | Path Variables). %IDEA_RUN:TOMCAT_HOME% is used internally by IDEA to store
paths to startup scripts relatively to Tomcat home.

Why do you need 'TOMCAT_HOME' path variable? Tomcat server configuration is stored on the global level and referenced from projects by its name so
this variable seems to be useless. You can remove this variable to workaround the problem until it is fixed.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Avatar
Permanently deleted user

The problem is, that if we remove the path variable we get entries in the run configurations like this:

<option name="SCRIPT" value="$PROJECT_DIR$/../tomcat.git/bin/catalina.sh" />



If another developer uses another directory structure to store his Tomcat, it will change constantly. That was the reason for the introduction of the path variable.

What shall we change to make this more robust against VCS changes?

Thank you.
0
Avatar
Permanently deleted user

Does "$PROJECT_DIR$/../tomcat.git" path equal to the path specified in 'Tomcat Home' field in the Tomcat Server settings for the server selected in
the run configuration?

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Avatar
Permanently deleted user

Yes, it does:

  • Application Servers > Tomcat > Tomcat Home: /Users/tmeinen/Development/tomcat.git
  • $PROJECT_DIR$: /Users/tmeinen/Development/my-project
  • $TOMCAT_HOME$: /Users/tmeinen/Development/tomcat.git
0
Avatar
Permanently deleted user

What is specified in 'Startup Script' field on 'Startup/Connection' tab of the Tomcat run configuration? If that path contains '/../' try to rewrite
the path without it.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Avatar
Permanently deleted user

"Use default" is activated:

Screen Shot 2012-05-07 at 9.10.52 AM.png

0
Avatar
Permanently deleted user

Nikolay,

do you have any other ideas how we can fix this problem? It is very annoying for the developers in the team, that the files changes so often. Shall I create a YouTrack issue for this?

Thank you

0
Avatar
Permanently deleted user

Hmm, if 'Use default' checkbox is selected path to the startup script should not be saved at all. To workaround the problem you can unselect 'Use
default' checkbox, clear 'Startup script' field and select 'Use default' again. After that 'script' option will be cleared in the run configuration
xml file.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Avatar
Permanently deleted user

Hi Nikolay,

thank you for your answer. Although your suggested steps removed the TOMCAT_HOME variables, we now have another problem:

Screen Shot 2012-05-11 at 11.19.11 AM.png

Everytime we modify something in the Tomcat Run Configuration a new space character will be inserted into the XML file as seen in the screenshot. The amount of spaces are growing continuously.

I already tried:

  • removing the spaces from within IDEA
  • removing the spaces with an external editor after the project was closed
  • disabled "use default", apply, removed spaces in startup script, apply, enabled "use default"


Nothing helped, everytime I modify the run configuration, there will be spaces added to xml.

0
Avatar
Permanently deleted user

We will fix the problem with spaces, thank you. Until it is fixed you can try the following workaround:
1) Uncheck 'Use default'.
2) Specify path to any existing file under the project home folder in 'Startup script' field.
3) Check 'Use default'.
After that the 'script' element in the configuration xml file will be filled with the specified path collapsed using $PROJECT_DIR$ so it won't be
changed when you open the project on a different computer.
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Avatar
Permanently deleted user

Nice idea to workaround the problem. ;)

Did you create a YouTrack issue for the spacing problem, so that I can follow the progress?

0
Avatar
Permanently deleted user

btw: reopening the run configuration and unchecking "use default" a new trailing space is added to the path to the file in the project dir. Maybe the problem are the parameters " run" and " stop" which are added to catalina.sh.

0
Avatar
Permanently deleted user

The problem with growing spaces is already fixed and the fix will be included in the next IDEA 11.1.2 build. I've created an issue about saving path
to the script when 'Use default' option is selected (http://youtrack.jetbrains.com/issue/IDEA-86026), but I don't think that we will fix it in IDEA
11.1.x because it will change existing run configurations.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Avatar
Permanently deleted user

Yes, the additional space is indeed added in the editor. However it shouldn't be stored in the xml file.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Please sign in to leave a comment.