It's all about the answers!

Ask a question

Maven SCM Plugin for RTC


0
4
David Lafreniere (4.8k7) | asked Jul 20 '10, 3:41 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
edited Oct 06 '16, 10:24 a.m.
Please use this forum topic to discuss the ongoing development of the Maven SCM Plugin for RTC.

I would especially like to know how users intend to use the Maven SCM Plugin and especially the Maven Release plugin in the context of RTC.

What would really help is if you could provide a short description of what you feel each scm goal should do. (What would help even more if you could provide a sample Jazz SCM CLI line on exactly what you feel should be done).

Often difficulty occurs because we are bound to the Maven SCM Plugin framework, and the level of information supplied to us for each goal may be too little or to much in order to easily map it 1:1 to an RTC use case scenario. RTC SCM is great at being flexible for team (or even personal) use, but it also has many "things" that other traditional SCM systems do not.

Questions of discussion could be:

1. Should the checkin goal automatically create and "complete" a change set with the given message/comment every time the checkin goal is executed?. Should it also "deliver" this change set with every checkin goal? or should it just check in files to the existing change set?

2. The checkout goal allows an optional passed in ScmVersion Maven object. For example, the release-plugin calls this checkout goal in the release:perform goal and used this ScmVersion object to represent a "snapshot" which was created in the release:prepare goal. However Jazz RTC does not allow you to checkout (i.e. "load") a particular snapshot. Can we come up with an agreed upon action for this scenario?
2a. One option would be to temporarily create another repository workspace which is based on the given snapshot. This would allow the user to checkout the files properly. However one problem is that these SCM goals act against the workspace defined in the SCM URL (in the pom.xml), thus future goals such as (status or checkin) would be against the original repository workspace, and not the one we checked out of...

3. The "project structure" of Maven projects and RTC/Eclipse projects are different. Maven has the concept of "parent projects" in which entire child projects exist below a parent project, whereas in Eclipse/RTC each project generally exists at the same root level. At the surface this doesn't appear to be a problem, but some Maven users may not be able to do what they want with the Jazz SCM provider. In particular, Jazz SCM does not allow checking out a project underneath another checked out project (i.e. can't have a sandbox in a sandbox).
3a. Ex: During an initial test run of release:perform (after performing after a release:prepare), I saw that the supplied checkout directory was "<releaseProject>\target\checkout" (Which Jazz Scm cannot do).

Please see the following Wiki document for additional information.
https://jazz.net/wiki/bin/view/Main/BuildFAQ#Does_Jazz_Team_Build_support_Mav

104 answers



permanent link
Nick Edgar (6.5k711) | answered Feb 03 '12, 9:54 a.m.
JAZZ DEVELOPER
Hi Sandor. We're working towards getting the source for the Jazz SCM provider contributed to Apache Maven project. Chris has the latest source, and has offered to help broker the source to Apache.

Chris, in the meantime, I'm fine with you sending Sandor the source, with any fixes you've applied.

permanent link
Chris Graham (367814) | answered Feb 02 '12, 6:43 p.m.
I just realised that I had not posted all of the example code that I used to test this.

The sample pom.xml above, references the file: zip-for-release-no-deps.xml, and here it is:


<?xml version='1.0' encoding='UTF-8'?>
<assembly>
<id>bin</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<dependencySets>
<dependencySet>
<useTransitiveDependencies>false</useTransitiveDependencies>
<useProjectArtifact>false</useProjectArtifact>
</dependencySet>
</dependencySets>
</assembly>

permanent link
Chris Graham (367814) | answered Feb 02 '12, 5:57 p.m.
Hi Sandor,

No, the source is not currently available.

That, in and of itself will not help you, as you'll need to have some corresponding changes made to the release plugin as well. I documented the exact nature of these required changes earlier in this thread.

You've said above, that the build fails at an earlier point. Can you please run mvn with the -X switch and either email me the results (if too big) or post here. I'm really curious as to why it would be failing at an earlier point.

Also, could you please try putting the jazz_xxx variables that you are currently passing in via the command line (and via -Darguments) into the properties section of your settings.xml and see if they are still being passed through? For example:


<properties>
<jazz_user>me</jazz_user>
<jazz_password>pwd</jazz_password>
</properties>


etc.

That is another means of passing things through to mvn (just make sure that it is in an active profile!)

If in doubt, then run this:


mvn org.apache.maven.plugins:maven-help-plugin:2.1:system


And of course, to see how everything is being resolved, use:


mvn help:effective-pom


Looking forward to seeing the output from -X.

-Chris

Hi,

Is it possible to download the sources for jazz scm provider maven plugin?

Where?

How?

Thanks,
Sandor

permanent link
Ecker Sandor (46) | answered Feb 02 '12, 6:06 a.m.
Hi,

Is it possible to download the sources for jazz scm provider maven plugin?

Where?

How?

Thanks,
Sandor

permanent link
Chris Graham (367814) | answered Feb 01 '12, 10:59 p.m.
Hi Sandor,

Re 1.

Yes, that is flattened. :-(

Allegedly, the release plugin has been 'fixed' to allow for this case. There have also been reports that is has not always worked.

Personally, I don't trust it.

So, at least for the purposes of testing, can you create a nested version? (as another component, if need be), where the root *is* the root. I'm assuming that root dir only has a pom.xml in it, that contains the scm and the modules clauses in it.

Re 4.
Ok, reintroducing the passed in variables and the problem re-occurs.

:-)

That is really looking like the issue then, and the -Darguments is meant to address that.

Re 5.
Anything in the global settings is available in the user's settings. And I noticed that the release process generates it's own and uses that instead. Just wanting to avoid issues.

Re 6.
I don't think that your post was completed. It ends in "more early, and"
...
?????

:-)

-Chris

permanent link
Ecker Sandor (46) | answered Feb 01 '12, 8:52 a.m.
5. I'm using the global settings because we have a problem with our Nexus server. This is just a WA to use the companies proxy instaed nexus.

6. The properties are coming from the command line. If I try it like this:


sh-4.1$ mvn --global-settings d:/CG/tools/cg-tools-runtime-java/apache-maven/conf/settings.proxy.xml -B release:prepare -Darguments="-Djazz_username=z00**** -Djazz_password=****** -Djazz_repositoryWorkspace=ecker_CG_ConfigurationManagement"


Than I get errors more early. And the scmurl is not filled out, and none of the scm commands work.

A few more:

5. Why the usage of the global settings? Why not the usual ~/.m2/settings.xml? I forbid modifications to the global settings.xml in <maven_home>/conf/settings.xml. That is part of the distribution, and if you modify this file, then you need to replicate it across *ALL* installations of maven. I have the following installations of maven on all of my machines: 2.0.9, 2.0.11, 2.2.1, 3.0-beta-1, 3.0-beta-2, 3.0-beta-3, 3.0, 3.0.1, 3.0.2 and 3.0.3. Please don't use the global one. Use ~/settings.xml instead - that is what it's for.
Additionally, I do not know if that is passed on through to the maven that is spawned by the release process.
6. Where are your jazzUser, jazzPassword and jazzWorkspace (really, really bad idea that one) coming from? From the command line via -D... or as properties defined in the settings.xml file?
If it is via the -D... it will not be passed onto the spawned instance of maven used by the release process. To pass parameters in via -D, you need to use the -Darguments value, ie:


mvn -B -Dresume=false -Darguments="-DBUILD_NUMBER=$BUILD_NUMBER" release:prepare release:perform


This is how I use the release process under Hudson. The Hudson build not, $BUILD_NUMBER is otherwise not passed through to the "mvn deploy" called by the release plugin.

-Chris

Ok, good, you've got it working on a single module.
With hard coded userid/password.

:-)
A few questions:
1. What is your project structure on disk? Nested or flattened?
2. Are you using the relativePath bits for the parent?
3. You only should have the SCM section in the root pom. Have you also specified it in the child poms? If so, remove it; they are not supported.
4. When you re-introduce the child poms, it still fails with the same error?

-Chris

If I remove the child projects from the modules tag in the parent pom, than it works fine.



Our root module is the cg-cm-root module, the superpom is child module under the root.

I general we have a lot of multi modul maven project, so I think it would be hard/not correct to version tham separately.

I can try to unconfigure the child modules from the root module to see if that fix the problem...

permanent link
Ecker Sandor (46) | answered Feb 01 '12, 8:09 a.m.
1. The structure is the following:

sh-4.1$ pwd
/cygdrive/d/CG/src/cg-cm
sh-4.1$ ls -ltr
total 0
drwx------+ 1 Administrators Domain Users 0 Jan 12 08:37 cg-cm-passwords
drwx------+ 1 Administrators Domain Users 0 Jan 12 08:47 cg-cm-Base
drwx------+ 1 Administrators Domain Users 0 Jan 31 08:51 cg-cm-superpom
drwx------+ 1 Administrators Domain Users 0 Jan 31 08:51 cg-cm-cfg
drwx------+ 1 Administrators Domain Users 0 Jan 31 09:49 cg-cm-root
sh-4.1$

so it is flatterned I think.

I was in the cg-cm-root dir when I started mvn release:prepare.

2. Yes, relativePath tag is there in the <parent> sections of the child modules.

3. Only one <scm> section is there in the root pom.

4. Yes, when I reintroduce tham it fails again.


Ok, good, you've got it working on a single module.
With hard coded userid/password.

:-)
A few questions:
1. What is your project structure on disk? Nested or flattened?
2. Are you using the relativePath bits for the parent?
3. You only should have the SCM section in the root pom. Have you also specified it in the child poms? If so, remove it; they are not supported.
4. When you re-introduce the child poms, it still fails with the same error?

-Chris


permanent link
Chris Graham (367814) | answered Feb 01 '12, 1:23 a.m.
A few more:

5. Why the usage of the global settings? Why not the usual ~/.m2/settings.xml? I forbid modifications to the global settings.xml in <maven_home>/conf/settings.xml. That is part of the distribution, and if you modify this file, then you need to replicate it across *ALL* installations of maven. I have the following installations of maven on all of my machines: 2.0.9, 2.0.11, 2.2.1, 3.0-beta-1, 3.0-beta-2, 3.0-beta-3, 3.0, 3.0.1, 3.0.2 and 3.0.3. Please don't use the global one. Use ~/settings.xml instead - that is what it's for.
Additionally, I do not know if that is passed on through to the maven that is spawned by the release process.
6. Where are your jazzUser, jazzPassword and jazzWorkspace (really, really bad idea that one) coming from? From the command line via -D... or as properties defined in the settings.xml file?
If it is via the -D... it will not be passed onto the spawned instance of maven used by the release process. To pass parameters in via -D, you need to use the -Darguments value, ie:


mvn -B -Dresume=false -Darguments="-DBUILD_NUMBER=$BUILD_NUMBER" release:prepare release:perform


This is how I use the release process under Hudson. The Hudson build not, $BUILD_NUMBER is otherwise not passed through to the "mvn deploy" called by the release plugin.

-Chris

Ok, good, you've got it working on a single module.
With hard coded userid/password.

:-)
A few questions:
1. What is your project structure on disk? Nested or flattened?
2. Are you using the relativePath bits for the parent?
3. You only should have the SCM section in the root pom. Have you also specified it in the child poms? If so, remove it; they are not supported.
4. When you re-introduce the child poms, it still fails with the same error?

-Chris

If I remove the child projects from the modules tag in the parent pom, than it works fine.


sh-4.1$ mvn --global-settings d:/CG/tools/cg-tools-runtime-java/apache-maven/conf/settings.proxy.xml -B release:prepare
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building cg-cm-root 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-release-plugin:2.2.2:prepare (default-cli) @ cg-cm-root ---
[INFO] scmUrl - z001pb6k;****@https://bwga046a.ww009.net:9443/ccm:ecker_CG_ConfigurationManagement
[INFO] Scheme - https
[INFO] Verifying that there are no local modifications...
[INFO] ignoring changes on: pom.xml.next, release.properties, pom.xml.releaseBackup, pom.xml.backup, pom.xml.branch, pom.xml.tag
[INFO] scmUrl - z001pb6k;****@https://bwga046a.ww009.net:9443/ccm:ecker_CG_ConfigurationManagement
[INFO] Scheme - https
[INFO] Command line - cmd.exe /X /C "scm status --username z001pb6k --password **** --wide"
[INFO] err -
[INFO] Checking dependencies and plugins for snapshots ...
[INFO] scmUrl - z001pb6k;***@https://bwga046a.ww009.net:9443/ccm:ecker_CG_ConfigurationManagement
[INFO] Scheme - https
[INFO] Transforming 'cg-cm-root'...
[INFO] scmUrl - z001pb6k;***@https://bwga046a.ww009.net:9443/ccm:ecker_CG_ConfigurationManagement
[INFO] Scheme - https
[INFO] Not generating release POMs
[INFO] Executing goals 'clean verify'...
[INFO] [INFO] Scanning for projects...
[INFO] [INFO]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building cg-cm-root 0.0.1
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO]
[INFO] [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ cg-cm-root ---
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD SUCCESS
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 0.578s
[INFO] [INFO] Finished at: Tue Jan 31 09:22:09 CET 2012
[INFO] [INFO] Final Memory: 2M/15M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] Checking in modified POMs...
[INFO] scmUrl - z001pb6k;***@https://bwga046a.ww009.net:9443/ccm:ecker_CG_ConfigurationManagement
[INFO] Scheme - https
[INFO] Command line - cmd.exe /X /C "scm status --username z001pb6k --password *** --wide"
[INFO] err -
[INFO] Command line - cmd.exe /X /C "scm checkin --username z001pb6k --password *** D:\CG\src\cg-cm\cg-cm-root\pom.xml"
[INFO] err -
[INFO] Tagging release with the label cg-cm-root-0.0.1...
[INFO] scmUrl - z001pb6k;***@https://bwga046a.ww009.net:9443/ccm:ecker_CG_ConfigurationManagement
[INFO] Scheme - https
[INFO] Command line - cmd.exe /X /C "scm create snapshot --repository-uri https://bwga046a.ww009.net:9443/ccm --username z001pb6k --password *** --name cg-cm-root-0.0.1 --description "[maven-release-plugin] copy for tag cg-cm-root-0.0.1" ecker_CG_ConfigurationManagement"
[INFO] err -
[INFO] Transforming 'cg-cm-root'...
[INFO] scmUrl - z001pb6k;***@https://bwga046a.ww009.net:9443/ccm:ecker_CG_ConfigurationManagement
[INFO] Scheme - https
[INFO] Not removing release POMs
[INFO] Checking in modified POMs...
[INFO] scmUrl - z001pb6k;***@https://bwga046a.ww009.net:9443/ccm:ecker_CG_ConfigurationManagement
[INFO] Scheme - https
[INFO] Command line - cmd.exe /X /C "scm status --username z001pb6k --password *** --wide"
[INFO] err -
[INFO] Command line - cmd.exe /X /C "scm checkin --username z001pb6k --password z001pb6k D:\CG\src\cg-cm\cg-cm-root\pom.xml"
[INFO] err -
[INFO] Release preparation complete.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:29.564s
[INFO] Finished at: Tue Jan 31 09:23:08 CET 2012
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
sh-4.1$




Our root module is the cg-cm-root module, the superpom is child module under the root.

I general we have a lot of multi modul maven project, so I think it would be hard/not correct to version tham separately.

I can try to unconfigure the child modules from the root module to see if that fix the problem...

permanent link
Chris Graham (367814) | answered Jan 31 '12, 10:02 p.m.
Hi Sandor,

I'm using RTC 3.0 (RTC-I20101112-1731) from the about page of the RTC Eclipse tool.

When I see the version of scm, I see:


C:\>scm -v
com.ibm.team.filesystem.cli.tools, version 2.1.0.v20101110_2353
Subcommands: tools.verify tools.validate tools.echo.stdin tools.configvalue tools.log

com.ibm.team.filesystem.cli.client, version 2.1.0.v20101110_2353
Subcommands: load login logout create create/workspace create/baseline create/changeset create/snapshot create/component changeset changeset/comment changeset/complet
current changeset/relocate changeset/associate changeset/disassociate changeset/suspend changeset/resume changeset/discard changeset/extract change-target change-target
hange-target/component change-target/unset-workspace list list/workspaces list/projectareas list/teamareas list/streams list/components list/remotefiles list/credential
ns list/snapshots list/locks list/properties list/changesets list/users checkin accept deliver status conflicts resolve move lastmod share discard undo compare history
workspace workspace/add-components workspace/remove-components workspace/replace-components property property/list property/get property/set property/remove lock lock/l
uire lock/release annotate snapshot snapshot/promote refresh users users/set

com.ibm.team.filesystem.cli.core, version 2.1.0.v20101110_2353
Subcommands: help version daemon daemon/start daemon/stop

C:\>


Hi.

I have the following in my scm section:


<scm>
<connection>scm:jazz:${jazz_username};${jazz_password}@https://bwga046a.ww009.net:9443/ccm:${jazz_repositoryWorkspace}</connection>
<developerConnection>scm:jazz:${jazz_username};${jazz_password}@https://bwga046a.ww009.net:9443/ccm:${jazz_repositoryWorkspace}</developerConnection>
</scm>


I provide the parameters from command line.

Is that wrong?

Hi. I'm using 3.0.

Check your path in the SCM section of your Pom.

It must be wrong as it's only passing the server name through. It needs to be the full URL to the repo. It needs more than that. See my examples above for reference.

-Chris

Hi,

Which version from RTC are You using? For me with RTC 3.0 I get:


[INFO] Command line - cmd.exe /X /C "scm create snapshot --repository-uri https://bwga046a.ww009.net --username z0**** --password ****** --name cg-cm-root-0.0.1 --description "[maven-release-plugin] copy for tag cg-cm-root-0.0.1" 9443"
[INFO] err - Problem running 'create' 'snapshot':
Could not log in to https://bwga046a.ww009.net as user z001pb6k: CRJAZ1371E The URL "https://bwga046a.ww009.net:443/versionCompatibility?clientVersion=3.0" cannot be reached. The server cannot be reached. The network could not connect to the server. The error is "Connection refused: connect". Contact your system administrator.


Thanks, Sandor


Alright. We have success!

Of a sort. Kind of.


permanent link
Chris Graham (367814) | answered Jan 31 '12, 9:58 p.m.
Hi Nick.

No I don't belive it is an issue.

Until the user id and password were hard coded, and the error persisted (still waiting on confirmation on that one), I was thinking that it was a parsing error. Just a guess on my part. When I'm back at work, I'll see if I can get a multi module project working the same way, and see what I come up with.

The error is manifesting itself here in the release:prepare stage. That always worked for me.

The error was at the release:perform stage. The correct tag/snapshot was not being checked out. This is caused by the scm plugin not accepting the tag/branch details of the passed in parameters of the checkout command (which appears to have been written specifically for the release plugin).

The work around here, was to manual edit the release.properties file. Change the URL's in it to point to the tag not the trunk/working workspace.

-Chris

> Chris, you mentioned having to tweak the actual Maven release plugin to properly handle an scm url transformation.

Chris, do you think this could be a factor in what Sandor is seeing?

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.