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
| Old | New | |
| Chris Hagmann (chagmann) - 22 months ago (17 Jan 2007 16:17) | ||
Dave Whitla (dwhitla)
23 months ago (06 Dec 2006 16:06)Exactly the same problem for me
Alexey Gopachenko (neuro159)
23 months ago (06 Dec 2006 16:18)Path variables can be configured through system properties on agent. Navigate to BuildAgent\conf\buildAgent.properties
and add required
system.variable_name=path
Tobias Kurzke (tkurzke)
23 months ago (11 Dec 2006 13:58)It doesn't work, the set variables aren't resolved by the build agent.
Please re-open the issue, as this is a really high priority one!
Alexey Gopachenko (neuro159)
23 months ago (11 Dec 2006 14:30)Can you please provide more detailed description of what are you doing, what is expected and acheived result?
Tobias Kurzke (tkurzke)
23 months ago (11 Dec 2006 14:38)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.
Tobias Kurzke (tkurzke)
23 months ago (13 Dec 2006 16:37)It would be great if this could be already fixed in 1.2, because otherwise the .ipr runner is useless in a shared environment until February, and this is just an estimate...
It's a critical bug after all.
Kirill Maximov (maxkir)
23 months ago (13 Dec 2006 17:58)Will fix in 1.2
Kirill Maximov (maxkir)
22 months ago (12 Jan 2007 16:41)For each path variable you'll have to specify path.macro.VARNAME system property. In your case you'll have to specify path.macro.M2_REP system property and set it to corresponding value.
Niels Ull Harremoës (nielsull)
22 months ago (17 Jan 2007 15:14)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??
serverUrl=http\://localhost\:80
name=PFACDBL04
workDir=F\:\\Builder_Work
env.JAVA_HOME=d\:\\jdk1.5.0_07
ownPort=9090
system.path.macro.MAVEN_REPOSITORY=f:\\maven_repo
path.macro.MAVEN_REPOSITORY=f:\\maven_repo
env.path.macro.MAVEN_REPOSITORY=f:\\maven_repo
MAVEN_REPOSITORY=f:\\maven_repo
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
Tobias Kurzke (tkurzke)
22 months ago (17 Jan 2007 15:35)I get the same error when using the Inspection-runner:
In order for the project to load all path variables must be defined.: M2_SETTINGS, MILANO_FUTURE_HOME, M2_REPO
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.
Kirill Maximov (maxkir)
22 months ago (17 Jan 2007 16:04)Unfortunately, Inspection runner uses other syntax than Ipr runner. We'll fix this in Agra.
For Ipr runner, you need to specify path.macro.VAR system property.
For Inspection runner, you need to specify just VAR system property.
Tobias Kurzke (tkurzke)
22 months ago (17 Jan 2007 16:17)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
In order for the project to load all path variables must be defined.: M2_REPO
even If I configure these variable as system variable in the Inspection build configuration (which isn't necessary for Ipr-runner).