Maven2: parent pom not found by TeamCity (even though the build works)
I have the following in my project's pom:
<parent>
<groupId>com.mycompany.myproject</groupId>
<artifactId>uber-pom</artifactId>
<version>4</version>
</parent>
The maven2 build works fine both from command line and in TeamCity, com.mycompany.myproject:uber-pom:4 is downloaded from the repository. However, when I set the build number format to include %maven.project.version%, this variable does not get resolved. Furthermore, the Maven 2 tab of build configuration reports an error:
An error occurred during collecting Maven data: org.apache.maven.reactor.MavenExecutionException: Cannot find parent: com.mycompany.myproject:uber-pom for project: com.mycompany.myproject:project-name:jar:2.5.0-SNAPSHOT for project com.mycompany.myproject:project-name:jar:2.5.0-SNAPSHOT
A partial solution was to supply a <relativePath> in <parent> and modify the checkout rules so that the uber-pom is checked out together with project-name. This is not ideal though since I have to ensure that the version of uber-pom that is checked out always matches the version specified in project-name's pom -- otherwise the problem remains.
Is it a known problem and is there any solution or work-around?
Regards,
Maciek
Please sign in to leave a comment.
This is all smoother in TC6 anyway, right? I'm just waiting to upgrade to that :)
This particular behavior hasn't changed, and unlikely to change in 6.0. Sorry. I'm thinking of an ability to specify separate settings for individual TeamCity projects and build configurations via UI. And we're open for suggestions. Do you have any?
First of all, I got it working with localhost and 127.0.0.1. I cleared the artifacts from the data directory cache and tried again with google.com as the URL to prove that it would fail. It did. I then switched to localhost, 127.0.0.1, repeating the same steps and it worked both times. I caused it to fail again by re-adding the build configuration settings to point to a specific maven installation and user settings file. As long as TeamCity picks up the SAME Maven installation via M2_HOME and config file from its own home directory it all works. Adding the build configuration specific settings in the mix seems to cause some bug.
As far as suggestions go, yes, I have one. I maintain a fairly robust series of MOJOs for Maven that integrate .NET tools such as MSBuilt, MSTest, xsd, wsdl, WiX, etc. at http://sf.net/projects/nvn. However, the Maven build runner doesn't allow me to tell TeamCity that there is a .NET unit test result file (TRX) file to read. I use Maven to build .NET because NVN publishes .NET artifacts on repositories and makes dealing with .NET dependencies as easy as dealing with Java dependencies. Several major companies use NVN and I've been meaning to finally write up documentation on it. For now it would just be nice for your Maven build runner to allow me to specify a .NET test results file to display as a tab. Or run display code coverage results from FX cop. Just a thought.
Thanks!
Maven home path and settings path affects only build on agents and not Maven2 tab in any way. If you can reproduce this problem, could you please provide the exact error message and the log snippet.
As for .NET test results, if they are compatible with NUnit format you can setup XML report processing for your build in the bottom of the test runner page.
Also I'm not quite sure I understood your words about FxCop. Are you talking about the saparate FxCop TeamCity runner (which exists in TC 5), or about having this ability inside Maven runner?
Matters are probably complicated by the fact that the build server and agent are on the same system. .NET test results are not compatible with NUnit, but TC actually supports .NET's TRX (MSTest) format in the Visual Studio build runners, so I know that TC can parse TRX. Ultimately, whether its FxCop or test result processing, I'd like to have the ability to add post processing of files to any build runner (in this case Maven2) that I know is supported in some other build runner (for example, FxCop or sln2008).
Thank you for the clarification. This definitely makes sense. We continuously enhance our XML report processing module with new formats. Your requests are now in the future list. :) I'll also take a look at NVN. Thank you for pointing!
FYI, by tweaking your build a bit you can have automatic MSTest reporting in it - http://confluence.jetbrains.net/display/TCD5/MSTest+Support
Done. NVN now parses the stdout from MSTest and grabs the results file and emits the appropriate message.

[INFO] NVN-mstest: ##teamcity[importData type='mstest' path='Z:\akutz\Projects\dotnet\emc-vsi-core\TestResults\akutz_LUCY 2010-09-28 16_01_47.trx']
The result is a beautiful inclusion of MSTests in a Maven2 runner. Thank your help!
Does TC understand dotCover reports? If so I'll create a MOJO that runs dotCover and emits the appropriate TC message so that the build server picks it up.
DotCover will be supported starting from 6.0. In 5.x only NCover is supported. See http://confluence.jetbrains.net/display/TCD5/Manually+Configuring+Reporting+Coverage