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
David Lafreniere (4.8k7) | answered May 17 '11, 5:07 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

err - 'scm' is not recognized as an internal or external command,
operable program or batch file.


This means that your operating system (command line) cannot find a program called "scm" i.e the "the scmtools scm.exe". If you go to your command line prompt and type "scm" <enter>, you should see the same error. You would have to update your PATH environment variable to include the scmtools directory. The "scmtools" directory should be within the "jazz" folder along side the "client" folder (where your RTC client lives). This is where you will find the "scm.exe" file which represents the SCM command line.


I will update the Wiki to indicate that users should do this.

permanent link
Bousaselham Salmi (21) | answered May 19 '11, 1:03 p.m.
Thanks David for your help!

New, I'm facing a new error, its about URL. I define my URL as described in JAZZ documentation: scm:jazz:username@http://server_name:port/jazzPath:repositoryWorkspace

When I perform "mvn release:prepare" and after all projects build success, I get the following error:

------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 1:13.374s
Finished at: Thu May 19 12:19:19 EDT 2011
Final Memory: 156M/495M
------------------------------------------------------------------------
Checking in modified POMs...
scmUrl - user;password@https://servername:serverport/jazz:workspace
Scheme - https
Command line - cmd.exe /X /C "scm status --username user --password password --wide"
err -
Command line - cmd.exe /X /C "scm checkin --username user --password password ...l"
err -
Tagging release with the label sprint3...
scmUrl - user;password@https:/
Scheme - null

...

------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 2:43.919s
Finished at: Thu May 19 12:19:42 EDT 2011
Final Memory: 9M/495M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on project build-continuous: Jazz Url "https" is not a valid URL. The Jazz Url syntax is scm:jazz:username@http://server_name:port/jazzPath:repositoryWorkspace ->
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on project build-continuous: Jazz Url "https" is not a valid URL. The Jazz Url syntax is scm:jazz:username@http://server_name:port/jazzPath:repositoryWorkspace
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoFailureException: Jazz Url "https" is not a valid URL. The Jazz Url syntax is scm:jazz:username@http://server_name:port/jazzPath:repositoryWorkspace
at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:219)
at org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:181)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.apache.maven.shared.release.scm.ReleaseScmRepositoryException: Jazz Url "https" is not a valid URL. The Jazz Url syntax is scm:jazz:username@http://server_name:port/jazzPath:repositoryWorkspace
at org.apache.maven.shared.release.phase.ScmTagPhase.execute(ScmTagPhase.java:85)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:203)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:140)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:103)
at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:211)
... 22 more

Thanks,

B. Salmi.

permanent link
Bousaselham Salmi (21) | answered May 24 '11, 11:08 a.m.
Hi,

I steel have the error related to "https" url.

Could I have access to the "maven-scm-provider-jazz" plugin source code?


Thanks in advance.

Salmi.

permanent link
Rodrigo de Souza Valerio (21) | answered May 27 '11, 3:41 p.m.
Hi,

I steel have the error related to "https" url.

Could I have access to the "maven-scm-provider-jazz" plugin source code?


Thanks in advance.

Salmi.


Ok, i'm with this error since january.
David, any news??? Source code?? Snapshot?? new version???

Salmi, i'm thinking in create a new release maven plugin for rtc, just using the rtc scm command line tool. Do you have interest in colaborate???

Rodrigo Valerio.

permanent link
Bousaselham Salmi (21) | answered May 27 '11, 7:56 p.m.
Hi Rodrigo,

Yes, I'm interesting to develop a plugin for RTC if David doesn't share the existing one. Also, I'm open to collaborate in the existing one.

Thanks

Salmi.

permanent link
Teemu Lehto (21) | answered Jun 06 '11, 3:30 a.m.
Hi

I'm getting this error when executiong maven command "mvn release:prepare"

BUILD FAILURE
------------------------------------------------------------------------
Total time: 35.038s
Finished at: Mon Jun 06 10:21:42 EEST 2011
Final Memory: 5M/9M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.1
:prepare (default-cli) on project my-project: Execution default-cli of goal org.apa
che.maven.plugins:maven-release-plugin:2.1:prepare failed: Plugin org.apache.mav
en.plugins:maven-release-plugin:2.1 or one of its dependencies could not be reso
lved: The following artifacts could not be resolved: org.apache.maven.scm:maven-
scm-provider-jazz:jar:, org.apache.maven.scm:maven-scm-api:jar:: Failure to find
org.apache.maven.scm:maven-scm-provider-jazz:jar: in http://repo1.maven.org/mav
en2 was cached in the local repository, resolution will not be reattempted until
the update interval of maven-central-plugins has elapsed or updates are forced
->

I have unzipped ..\jazz\buildsystem\maven\jazz-scm-plugin.zip into my repository. I have also defined my repository as plugin repository in settings.xml.

How come maven still tries to resolve this dependency from http://repo1.maven.org/maven2????

-Teemu-

permanent link
Teemu Lehto (21) | answered Jun 06 '11, 4:08 a.m.


I have unzipped ..\jazz\buildsystem\maven\jazz-scm-plugin.zip into my repository. I have also defined my repository as plugin repository in settings.xml.

How come maven still tries to resolve this dependency from http://repo1.maven.org/maven2????

-Teemu-


Hi

I managed to resolve this. I had defined maven-central-plugins plugin repository with address http://repo1.maven.org/maven2 and forgot to set version to pom.xml file plugin dependencies.

I removed double plugin repository definition and added version tags to dependencies and now it works!

-Teemu-

permanent link
Teemu Lehto (21) | answered Jun 07 '11, 6:18 a.m.
In your opinion, do you think that i should open a work item for this? Or wait your feedback? (We are a IBM Partner formal client, and have some support, of course, not one that you can supply in this specific case :) )

Annother question, we have access to source code for tha jazz maven scm provider?

Thanks.


Hi Rodrigo,

We're planning on releasing the source so that the Maven community can maintain it. (I'll look into this shortly). Given that, instead of making Jazz work items, you can just report any issues here and I'll take a look at them (and hopefully fix them)


OK, I will wait eagerly for the next release and/or for the source code release to the maven comunity. If you can release a SNAPSHOT with the correction of the url repository missing infos, i will appreciate it. Thanks in advance.

Hi

I also had similar error in release:prepare

Command line - cmd.exe /X /C "scm create snapshot
--repository-uri https://my-server.address
--username username
--password password
--name release_tag
--description " copy for tag release_tag" 9443/jazz"
err - Problem running 'create snapshot':

Is there a fix or workaround available for jazz maven scm provider?
I'm using version 1.3

BR

Teemu

permanent link
Dennis Nørgaard (6) | answered Aug 04 '11, 4:37 a.m.
Hi David

I was just wondering what is the status of releasing the source?




Hi Rodrigo,

We're planning on releasing the source so that the Maven community can maintain it. (I'll look into this shortly). Given that, instead of making Jazz work items, you can just report any issues here and I'll take a look at them (and hopefully fix them)

permanent link
Teemu Lehto (21) | answered Aug 25 '11, 3:18 a.m.
Hi

I decided to write here additional info about these errors with maven-release-plugin and RTC.

For some reason repository-uri will be messed up in "scm create snapshot"-command (during mvn release:prepare) if maven module structure is flat. When I changed the module structure to hierarchical I managed to complete release preparation successfully. Read this if changing to hierarchical structure

Then I moved to release performing... And again problems! maven-release-plugin tries to do a checkout (snapshot version created in preparation) to main modules' target directory. This will cause creation of RTC sandbox inside of another RTC sandbox and that is not allowed.

I found workaround for these problems by creating a shell script that takes care of preparing and performing a maven release.

These are steps that my script executes:
1. Check parameters and environment (required folders exist, etc.)
2. Call mvn release:prepare in batch mode with required parameters
3. Deliver (scm deliver) checkedin changes during release preparation
4. Create release specific workspace (scm create workspace) from snapshot created during release:prepare
5. Make backup and modify release.properties (using sed) content and change workspace name (from parameter value to release specific)
6. Change temporarily the name of RTC sandbox repository directory (.jazz5 --> temp_name) to make it possible to mvn release:perform to load new release specific workspace to desired directory (<app_root_dir>/target/checkout/)
7. Call mvn release:perform
8. Cleanup after release: delete backups and work directories, restore RTC sandbox repository directory (temp_name --> .jazz5)

Hhmm... a little bit tricky but hope this will be useful for someone

-Teemu-

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.