Trouble getting file from VCSManager

I am building a Teamcity 4.5 plugin that requires me to get down to a project's pom file, so that I get to the project's artifact and groupId.  The issue is that I can't seem to get the file from the VcsManager.

I am using the following API code to do so:
byte[] fileContent = vcsManager.getFileContent(sBuildType, pomLocation);

The API states that the pomLocation should be the relative path to any of the VCSRoots. Which I would think would be something like this.

    Project: proj1 with Checkout rule +proj1\trunk=>.   and pom file located at the root directory of trunk, so I'm able to use the default pomfile location set up in the Maven2 Runner

     byte[] fileContent = vcsManager.getFileContent(proj1_BuildType, "pom.xml");

The only success I have had with getting anything back, after trying numerous combinations of vcs directories and pom file locations, actually returned me the revision history of a directory listed in the checkout rules.  Can anyone show me an example or explain what is the format expected for the "relative path in the given build configuration"?

1 comment
Comment actions Permalink

Hello, Nathan

The method VcsManager.getFileContent() should work exactly as you expected it to.
I'm not sure I understand what you mean by "the revision history of a directory listed in the checkout rules", but anyway if it doesn't work properly please enable debug logging for the category "jetbrains.buildServer.VCS", try again, and provide the corresponding log snippet from teamcity-vcs.log.
to enable debug logging add the line  <priority value="DEBUG"/> to the category definition in teamcity-server-log4j.xml

Thank you.


Please sign in to leave a comment.