Our Intellij project files have references to so-called "path variables" in it (e.g. $M2_REPOSITORY$) (see Intellij IDEA). Path variables are useful as placeholders when pointing to a library repository and where that location isn't always the same. (e.g. think of Windows and Linux cross-platform compatibility of project files).
The agent doesn't replace these placeholders in the project files with real values (e.g. stored in an environment variable or system property) before running, causing the build to fail.
Unfortunately we cannot adjust the project files with absolute paths for the following reasons:
- Different developers have the local Maven 2 repository at different locations
- Developers work on Windows while the TeamCity builds are done on Linux
Issue wasresolved
I defined several system variables in the build agent's property file as you described above.
For example, one of the entries in the property file is as follows:
system.M2_REPO=C\:\\Documents and Settings\\mstku\\.m2\\repository
In the .ipr file (and the referenced .iml-files), the path variable M2_REPO is used, which works perfectly well if I use the project in IDEA.
When I create a build configuration in TeamCity that uses the same .ipr-file, the build log contains warnings like this:
[2006-12-11 11:52:15,643] INFO - nt.runner.GenericProgramRunner - [generateBuild] Warning: C:/BuildAgent/work/6_MilanoFutureComplete/IdeaFuture/$M2_REPO$/log4j/log4j/1.2.12/log4j-1.2.12.jar - Library file doesn't exist
All the libraries in the Maven repository aren't found, because $M2_REP$ isn't resolved.
Could you please document exactly how to acheive this?
I am running 1.2 and have tried adding the following to my buildAgent.properties - and it still doesn't work??
And I have added these to the build settings.
And I have restarted the build agent.
But I still get the error:
In order for the project to load all path variables must be defined.: MAVEN_REPOSITORY
I get the same error when using the Inspection-runner:
java.lang.RuntimeException: There are undefined path variables in project configuration files.
When using the Ipr-Runner (same project on same build agent), the build log contains this:
[generateBuild] Loaded external path macro $M2_REPO$=C:\Documents and Settings\mstku\.m2\repository
[generateBuild] Loaded external path macro $M2_SETTINGS$=C:\Documents and Settings\mstku\.m2
[generateBuild] Loaded external path macro $MILANO_FUTURE_HOME$=C:\BuildAgent\work\Milano_Future_Complete
It looks like Ipr runner correctly replaces the path variables while the Inspection runner still can't handle this.
Please re-open the issue and fix it asap.
So in order to handle the Inspection runner and the Ipr runner, the buildagent.properties must contain something like
system.path.macro.M2_REPO=C\:\\Documents and Settings\\mstku\\.m2\\repository
and
system.M2_REPO=C\:\\Documents and Settings\\mstku\\.m2\\repository
I'm just asking, because it still doesn't work, running the Inspection runner with a build agent configured that way I still get
java.lang.RuntimeException: There are undefined path variables in project configuration files.
even If I configure these variable as system variable in the Inspection build configuration (which isn't necessary for Ipr-runner).
| Old | New | |
| Chris Hagmann (chagmann) - 19 months ago (17 Jan 2007 16:17) | ||
Dave Whitla (dwhitla)
20 months ago (06 Dec 2006 16:06)Exactly the same problem for me