Tuesday, June 21, 2011 5:53 PM
I have finally been able to use the maven release plugin from the command line. However is there a way to use the maven release plugin from Team Explorer?
For example if I want to run the following:
C:\TFSworkspace\BetaProject>mvn release:prepare -DuseEditMode=true C:\TFSworkspace\BetaProject>mvn release:perform -DuseEditMode=true -DconnectionUrl=scm:tfs:http://localhost:8080:mvnBuildWorkspaceToBeCreated:$/OTDATestProject/BetaProject -DworkingDirectory=C:\temp\mvn\Beta0621h -Dgoals="clean deploy"
From the Team Explorer GUI how would that be accomplished? I'm guessing I would have to modify the <MavenPomFile> tag in some way.
Also is there a way to pass in parameters to the build so that maven would be able to pick them up? One of the reasons that I would want to do this is so I can pass in the name of the version that I would like to label in TFS. If I do the above commands user input is required to put in the version numbers to be released.
Thanks for any information you can give.
Wednesday, June 22, 2011 4:45 PM
you can either update your Maven POM file (POM.xml) or you can edit your TFSBuild.proj file and add that goal "release:prepare" to the tag <MavenPomFile>. To edit the TFSBuild.Proj, you add a new goals node in the <MavenPomFile> node, it should look something like that
Please let me know if that does not answer your question
- Proposed As Answer by Mireille HannaMicrosoft Employee Wednesday, June 22, 2011 4:45 PM
Wednesday, June 22, 2011 5:51 PM
Thanks for the reply. I will give that a shot.
Do you have any knowledge about the second part of my question? Being able to pass parameters would be a big help in making the build files more generic. That way I wouldn't have to create one either for each build version or modify the old one each time I need to change the version.
Friday, June 24, 2011 10:17 AM
Does specifying "<Goals>release:prepare</Goals>" in <MavenPomFile> node in TfsBuild.proj actually work for you ?
I get an error when specifying anything with ":" in Goals node, which was already mentioned here.
Build is trying to create folder hierarchy according to all specified tokens in the Goal node (e.g. for "<Goal>clean install -Psomeprofile</Goal>" build will create folder "clean\install\-Psomeprofile") which is IMHO a total overkill and only causes problems (why not simply create a specific folder which will hold the log file and be done with it?).
Is there any build definition setup that will allow me to specify maven goal like: <Goal>install:install</Goal> and will not cause build to break ?
Without support for ":" in build goal it is very difficult to get any real value out of maven build support in TFS build.
Friday, June 24, 2011 7:15 PM
That's another issue, there is a bug in the Build Extensions power tool that causes the build to fail in case the goal has a ":" in its name.
Monday, June 27, 2011 2:49 PM
So are you saying that using a goal, in the TFSBuild.proj, that has a ":" should work but currently doesn't?
When will this be fixed? What other options does one have to get aroudn this?
I agree with Mario that for our Enterprise Solution it would be difficult to get real value out of a pure TFS solution without this working, we would have to look a different route.
Monday, November 21, 2011 10:28 AM
how about maven release:branch? Is that a way to use mvn release:branch -DupdateBranchVersions=true, and have a new created branch of my project/folder in TFS ? when I'm trying to release:branch from Eclipse or tf command on cmd, I get this error:
[INFO] Command line - cmd.exe /X /C "tf branch -login:[domain]\[username],[passwd] <path-to-my-maven-project> -checkin branch-test"
[INFO] err - An error occurred: TF10125: The path '<path-to-my-maven-project>' must start with $/
So, I have 2 questions:
1. I'm able to perform release:prepare and release:perform goals successfully, is there a way to be able to perform release:branch successfully?
2. If the answer to the 1st questions is YES, where should I define the <path-to-my-my-maven-project> when I'm calling maven release?
the command I'm using to call mvn release preapare and perform is this:
mvn -X -e -B release:clean release:prepare -DdevelopmentVersion=0.0.2-SNAPSHOT -DreleaseVersion=0.0.1 -DreleaseTag=cm-test_0.0.1 release:perform -DuseEditMode=true -Dusername=[domain]\[username] -Dpassword=[password] -DconnectionUrl=scm:tfs:http://[serverURL]:8080/tfs/[collectiom]:[workspace_name]:$/path/to/the/TFS/project -DworkingDirectory=h:\Temp\mvn -Dgoals=clean install
and it's working (partially, of course a tag/(folder to copy code from trunk) isn't created, and of course the maven artifact isn't automatically deployed to NEXUS (I understood that only mvn install goal is supported at this phase :) ) but I still can accept these issues), but when I'm trying to branch the code I'm getting the error described above.
Note: for mvn release:branch I'm using the following commands:
mvn -X -e release:branch -DupdateBranchVersions=true -DbranchName=branch-test -DuseEditMode=true -Dusername=[domain]\[username] -Dpassword=[password] -DconnectionUrl=scm:tfs:http://[serverURL]:8080/tfs/[collectiom]:[workspace_name]:$/path/to/the/TFS/project -DworkingDirectory=h:\Temp\mvn
or the simple command:
mvn release:branch -DupdateBranchVersions=true -DbranchName=branch-test -DuseEditMode=true
and both are not working and are throwing the above described error:
([INFO] Command line - cmd.exe /X /C "tf branch -login:[domain]\[username],[passwd] <path-to-my-maven-project> -checkin branch-test"
[INFO] err - An error occurred: TF10125: The path '<path-to-my-maven-project>' must start with $/)
Solutions for this?
Friday, December 02, 2011 1:13 AMOwnerThe ":" thing was fixed in the August release of the build extensions BTW. Sorry for not coming back sooner.
- Marked As Answer by Martin WoodwardMicrosoft Employee, Owner Saturday, December 10, 2011 7:03 PM
Tuesday, January 03, 2012 12:32 PM
I am facing the same issue as; what should be the way to pass command line arguments to maven (mvn) in case of TFS.
This question is itself very common in its usefulness and requirements as well, but missing from proper documentation of TEE to TFS builds.
Kindly help me out, if you already resolved this kind of purpose of passing maven command line arguments to TEE maven builds