Project relative artefact output path

Do PROJECT_DIR, MODULE_DIR macros not work as a artifacts exploded web artifact output directory?

Seems if I do use a variable I can build the artifact OK, contents look good. But when I try to launch tomcat and deploy the webapp I get an error dialog:

Error deploying 'myapp:war'

$PROJECT_DIR$/target/myapp-9.0 not found for web module


If I leave the output path to be relative it seems to get built in an unexpected folder under <userhome>/.IntelliJIdea12/system/compile-server/.. not the project home folder, or project output folder I'd expect?

Is there a way to not hardcode an absolute path (non-transferable between OSes).
4 comments

Do you specify $PROJECT_DIR$ by hand in the artifact editor? It doesn't work this way. You need to specify full path to the output directory and IDEA
will replace it by the relative path automatically before saving to the configuration xml file.

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

1

Yes I did specify it with $PROJECT_DIR$, though what I was trying to do was specify it in a way that was OS independant.
Either relative (doesn't work in a useful manner) or with a var/macro, but the absolute path it demands isn't portable.

0

Could you please specify the absolute path in the artifact editor, apply the changes, save the project and check what path is saved in
.idea/artifacts/artifact-name.xml?

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

0

Oh I think I get it. On Windows I see the artefact path being replaced by $PROJECT_DIR$. But the same project on Linux I see a full absolute path going down from /opt/....

What I think is going on is the /opt/... is the real full absolute path, it's quite deep and dissapers into a much larger eclipse workspace. So I created a symlink for the module folder under my home instead and I've been using that to open my .idea project. Guessing you can't mix a symlink opened project and an true absolute path here. They need to match.

0

Please sign in to leave a comment.