Weird variable appearing in my project file

Hi all,

I have a really strange problem which I can't work out. A workmate checked something into SVN, when I updated I had to restart the project because the ipr had been updated, and when restarting it complained about a missing path variable: M2_REPO. In my project file was the following:

The following is also added to my iws: $M2_REPO$/.subversion ]]>

Which I guess is why the IPR is saying that it's a referenced variable. We don't use Maven, BTW. I thought this was odd, but I just deleted it from my project file and continued. But now every time I delete both the above sections, IntelliJ puts them back as soon as I restart the project. What is going on here?

Cheers,
Colin

3 comments

Hello Colin,

I have a really strange problem which I can't work out. A workmate
checked something into SVN, when I updated I had to restart the
project because the ipr had been updated, and when restarting it
complained about a missing path variable: M2_REPO. In my project file
was the following:

<UsedPathMacros>
<macro name="M2_REPO" />
</UsedPathMacros>
The following is also added to my iws:

<component name="SvnConfiguration">
<option name="USER" value="" />
<option name="PASSWORD" value="" />
<option name="LAST_MERGED_REVISION" />
<option name="UPDATE_RUN_STATUS" value="false" />
<option name="UPDATE_RECURSIVELY" value="true" />
<option name="MERGE_DRY_RUN" value="false" />
<configuration
useDefault="false">$M2_REPO$/.subversion</configuration>
</component>
Which I guess is why the IPR is saying that it's a referenced
variable. We don't use Maven, BTW. I thought this was odd, but I just
deleted it from my project file and continued. But now every time I
delete both the above sections, IntelliJ puts them back as soon as I
restart the project. What is going on here?


Are there any other occurrences of M2_REPO in your ipr/iws/iml file?

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

This happens for me as well.

The variable name is different but it looks like defining a PATH variable at all in intellij causes that variable to get inserted into every project you open - whether it's specific/used in that project or not. (I didn't even know until I got busted by Hani for it on testng )

The theoretical maven2 support coming should probably eliminate the need for this at all - but ideally it would be nice if it let you use environment/shell variables instead of having to define them within idea. (ie export M2_REPO=/path for linux or the equivalent System environment variables in windows )

0

Right, I managed to sort this myself by deleting the variable from the Path Variables section. It's definitely viral though, when you open a project with this variable referenced but not defined it immediately forces you to define it yourself, and will then write it back. It also seems to automatically substitute that variable in any library references, and also in the SVN config, which was what I was seeing. Very annoying behaviour IMO.

Cheers,
Colin

0

Please sign in to leave a comment.