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
SUNIL KUURAM (6431923) | answered Sep 26 '11, 1:05 p.m.
I have just tried this. It doesn't seem to work. I've removed user ID and password from pom.xml and moved to settings.xml. It hangs on scm status command, i believe prompts and waits for password. Here is my configuration:

<scm>
<connection>scm:jazz:https://host:9103/jazz:CI-sunil-test</connection>
<developerConnection>scm:jazz:https://host:9103/jazz:CI-sunil-test</developerConnection>
<url>scm:jazz:https://host:9103/jazz:CI-sunil-test</url>
</scm>

...and under <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.0</version>
<configuration>
<tagBase>scm:jazz:https://host:9103/jazz:CI-sunil-test</tagBase>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-jazz</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-api</artifactId>
<version>1.3</version>
</dependency>

</dependencies>
</plugin>

settings.xml:
<server>
<id>jazz:9103</id>
<username>userid</username>
<password>password</password>
</server>


However, I've noticed scm login command has a -c (cache) option. Anyone knows how long this gets cached? This seems to be a viable solution...

Thanks
Sunil

Hello,

Has the source code for Jazz Maven SCM Provider plugin released yet? I went through the forums and wiki documents and noticed that the RTC user password has to be put in plain text within pom.xml, which is a serious audit issue. This becomes more serious due to the use of LDAP/Active Directory based logins. Any plans to fix this, or release the source code for this plugin soon....?

Thanks
Sunil

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)

Does it have to be included in the URL?

The normal way this is done is to define a <server> entry in the user's /.m2/settings.xml file. Then, only the server name is defined in the url of the pom.xml file. The server name is the <id> field of the <server> entry in the users settings.xml file. The <server> entry can then define, userId, password or ssh keys, file modes, permissions etc.

Eg:
<server>
<id>svn.server</id>
<username>chris</username>
<password>chris-password</password>
</server>

The pom.xml would look like this:

<scm>
<url>http://svn.server/svn/repos/MyProject/trunk</url>
<connection>scm:svn:http://svn.server/svn/repos/MyProject/trunk</connection>
<developerConnection>scm:svn:http://svn.server/svn/repos/MyProject/trunk</developerConnection>
</scm>

The jazz provider should work in a similar way. (Looking at the code, it should). Can someone please try? In this case, make sure that the server id includes the port no as well.

Eg:
<server>
<id>jazz:9443</id>
<username>chris</username>
<password>chris-password</password>
</server>

Note: The <server> entries are not just used for scm servers. They are also used for maven repositories and other things as well.

permanent link
Chris Graham (367814) | answered Sep 26 '11, 9:54 p.m.
Hmmm. Just to be sure, for this:


<scm>
<connection>scm:jazz:https://host:9103/jazz:CI-sunil-test</connection>
<developerConnection>scm:jazz:https://host:9103/jazz:CI-sunil-test</developerConnection>
<url>scm:jazz:https://host:9103/jazz:CI-sunil-test</url>
</scm>


The id in the settings should be:

<server>
<id>host:9103</id>
<username>userid</username>
<password>password</password>
</server>


-Chris

I have just tried this. It doesn't seem to work. I've removed user ID and password from pom.xml and moved to settings.xml. It hangs on scm status command, i believe prompts and waits for password. Here is my configuration:

<scm>
<connection>scm:jazz:https://host:9103/jazz:CI-sunil-test</connection>
<developerConnection>scm:jazz:https://host:9103/jazz:CI-sunil-test</developerConnection>
<url>scm:jazz:https://host:9103/jazz:CI-sunil-test</url>
</scm>

...and under <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.0</version>
<configuration>
<tagBase>scm:jazz:https://host:9103/jazz:CI-sunil-test</tagBase>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-jazz</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-api</artifactId>
<version>1.3</version>
</dependency>

</dependencies>
</plugin>

settings.xml:
<server>
<id>jazz:9103</id>
<username>userid</username>
<password>password</password>
</server>


However, I've noticed scm login command has a -c (cache) option. Anyone knows how long this gets cached? This seems to be a viable solution...

Thanks
Sunil

Hello,

Has the source code for Jazz Maven SCM Provider plugin released yet? I went through the forums and wiki documents and noticed that the RTC user password has to be put in plain text within pom.xml, which is a serious audit issue. This becomes more serious due to the use of LDAP/Active Directory based logins. Any plans to fix this, or release the source code for this plugin soon....?

Thanks
Sunil

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)

Does it have to be included in the URL?

The normal way this is done is to define a <server> entry in the user's /.m2/settings.xml file. Then, only the server name is defined in the url of the pom.xml file. The server name is the <id> field of the <server> entry in the users settings.xml file. The <server> entry can then define, userId, password or ssh keys, file modes, permissions etc.

Eg:
<server>
<id>svn.server</id>
<username>chris</username>
<password>chris-password</password>
</server>

The pom.xml would look like this:

<scm>
<url>http://svn.server/svn/repos/MyProject/trunk</url>
<connection>scm:svn:http://svn.server/svn/repos/MyProject/trunk</connection>
<developerConnection>scm:svn:http://svn.server/svn/repos/MyProject/trunk</developerConnection>
</scm>

The jazz provider should work in a similar way. (Looking at the code, it should). Can someone please try? In this case, make sure that the server id includes the port no as well.

Eg:
<server>
<id>jazz:9443</id>
<username>chris</username>
<password>chris-password</password>
</server>

Note: The <server> entries are not just used for scm servers. They are also used for maven repositories and other things as well.

permanent link
Chris Graham (367814) | answered Sep 26 '11, 10:04 p.m.
You should also be able to clean up the pom's and their replicated dependencies.

I had a chat to one of the maven commiters about the scm plugins, and their registration. The common approach appears to be to list the plugins as dependencies. The recommended way of doing this is to make use of the <extensions> attribute. It needs to be set to true. The best way of doing this would be to put the following into a parent pom (a good build practice to have common settings, and this is most easily achieved via a parent pom - all of my projects use this). Note: This is not a parent as defined in a multi module project. It is defined in the <parent> section in the pom.


<properties>
<maven>1.3</maven>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-jazz</artifactId>
<version>${maven-scm-provider-jazz.version}</version>
<inherited>true</inherited>
<extensions>true</extensions>
</plugin>
</plugins>
</build>


:-(
Broken formatting, set the following property and use it in the plugin.
maven-scm-provider-jazz.version = 1.3

See: https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=90042 for the full details.

The version has been defined as a property, so that in the future, any child pom may override it and change it (without having to re-release/change the parent pom).

Want to give it a go? That way it does not need to be also added as a dep of the release plugin.

-Chris

I have just tried this. It doesn't seem to work. I've removed user ID and password from pom.xml and moved to settings.xml. It hangs on scm status command, i believe prompts and waits for password. Here is my configuration:

<scm>
<connection>scm:jazz:https://host:9103/jazz:CI-sunil-test</connection>
<developerConnection>scm:jazz:https://host:9103/jazz:CI-sunil-test</developerConnection>
<url>scm:jazz:https://host:9103/jazz:CI-sunil-test</url>
</scm>

...and under <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.0</version>
<configuration>
<tagBase>scm:jazz:https://host:9103/jazz:CI-sunil-test</tagBase>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-jazz</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-api</artifactId>
<version>1.3</version>
</dependency>

</dependencies>
</plugin>

settings.xml:
<server>
<id>jazz:9103</id>
<username>userid</username>
<password>password</password>
</server>


However, I've noticed scm login command has a -c (cache) option. Anyone knows how long this gets cached? This seems to be a viable solution...

Thanks
Sunil

Hello,

Has the source code for Jazz Maven SCM Provider plugin released yet? I went through the forums and wiki documents and noticed that the RTC user password has to be put in plain text within pom.xml, which is a serious audit issue. This becomes more serious due to the use of LDAP/Active Directory based logins. Any plans to fix this, or release the source code for this plugin soon....?

Thanks
Sunil

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)

Does it have to be included in the URL?

The normal way this is done is to define a <server> entry in the user's /.m2/settings.xml file. Then, only the server name is defined in the url of the pom.xml file. The server name is the <id> field of the <server> entry in the users settings.xml file. The <server> entry can then define, userId, password or ssh keys, file modes, permissions etc.

Eg:
<server>
<id>svn.server</id>
<username>chris</username>
<password>chris-password</password>
</server>

The pom.xml would look like this:

<scm>
<url>http://svn.server/svn/repos/MyProject/trunk</url>
<connection>scm:svn:http://svn.server/svn/repos/MyProject/trunk</connection>
<developerConnection>scm:svn:http://svn.server/svn/repos/MyProject/trunk</developerConnection>
</scm>

The jazz provider should work in a similar way. (Looking at the code, it should). Can someone please try? In this case, make sure that the server id includes the port no as well.

Eg:
<server>
<id>jazz:9443</id>
<username>chris</username>
<password>chris-password</password>
</server>

Note: The <server> entries are not just used for scm servers. They are also used for maven repositories and other things as well.

permanent link
SUNIL KUURAM (6431923) | answered Oct 03 '11, 4:08 p.m.
Hello Chris,

Thanks for the respose. I have tried to use the extensions attribute as suggested, but getting this error:

The plugin descriptor for the plugin Plugin was not found. Please verify that the plugin JAR /devit_home/users/bldfge/.m2/CMST/org/apache/maven/scm/maven-scm-provider-jazz/1.3/maven-scm-provider-jazz-1.3.jar is intact.
------------------------------------------------------------------------
Trace
java.lang.IllegalStateException: The plugin descriptor for the plugin Plugin was not found. Please verify that the plugin JAR /devit_home/users/bldfge/.m2/CMST/org/apache/maven/scm/maven-scm-provider-jazz/1.3/maven-scm-provider-jazz-1.3.jar is intact.

Any idea?

Appreciate your help.

Thanks
Sunil

You should also be able to clean up the pom's and their replicated dependencies.

I had a chat to one of the maven commiters about the scm plugins, and their registration. The common approach appears to be to list the plugins as dependencies. The recommended way of doing this is to make use of the <extensions> attribute. It needs to be set to true. The best way of doing this would be to put the following into a parent pom (a good build practice to have common settings, and this is most easily achieved via a parent pom - all of my projects use this). Note: This is not a parent as defined in a multi module project. It is defined in the <parent> section in the pom.


<properties>
<maven>1.3</maven>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-jazz</artifactId>
<version>${maven-scm-provider-jazz.version}</version>
<inherited>true</inherited>
<extensions>true</extensions>
</plugin>
</plugins>
</build>


:-(
Broken formatting, set the following property and use it in the plugin.
maven-scm-provider-jazz.version = 1.3

See: https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=90042 for the full details.

The version has been defined as a property, so that in the future, any child pom may override it and change it (without having to re-release/change the parent pom).

Want to give it a go? That way it does not need to be also added as a dep of the release plugin.

-Chris

I have just tried this. It doesn't seem to work. I've removed user ID and password from pom.xml and moved to settings.xml. It hangs on scm status command, i believe prompts and waits for password. Here is my configuration:

<scm>
<connection>scm:jazz:https://host:9103/jazz:CI-sunil-test</connection>
<developerConnection>scm:jazz:https://host:9103/jazz:CI-sunil-test</developerConnection>
<url>scm:jazz:https://host:9103/jazz:CI-sunil-test</url>
</scm>

...and under <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.0</version>
<configuration>
<tagBase>scm:jazz:https://host:9103/jazz:CI-sunil-test</tagBase>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-jazz</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-api</artifactId>
<version>1.3</version>
</dependency>

</dependencies>
</plugin>

settings.xml:
<server>
<id>jazz:9103</id>
<username>userid</username>
<password>password</password>
</server>


However, I've noticed scm login command has a -c (cache) option. Anyone knows how long this gets cached? This seems to be a viable solution...

Thanks
Sunil

Hello,

Has the source code for Jazz Maven SCM Provider plugin released yet? I went through the forums and wiki documents and noticed that the RTC user password has to be put in plain text within pom.xml, which is a serious audit issue. This becomes more serious due to the use of LDAP/Active Directory based logins. Any plans to fix this, or release the source code for this plugin soon....?

Thanks
Sunil

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)

Does it have to be included in the URL?

The normal way this is done is to define a <server> entry in the user's /.m2/settings.xml file. Then, only the server name is defined in the url of the pom.xml file. The server name is the <id> field of the <server> entry in the users settings.xml file. The <server> entry can then define, userId, password or ssh keys, file modes, permissions etc.

Eg:
<server>
<id>svn.server</id>
<username>chris</username>
<password>chris-password</password>
</server>

The pom.xml would look like this:

<scm>
<url>http://svn.server/svn/repos/MyProject/trunk</url>
<connection>scm:svn:http://svn.server/svn/repos/MyProject/trunk</connection>
<developerConnection>scm:svn:http://svn.server/svn/repos/MyProject/trunk</developerConnection>
</scm>

The jazz provider should work in a similar way. (Looking at the code, it should). Can someone please try? In this case, make sure that the server id includes the port no as well.

Eg:
<server>
<id>jazz:9443</id>
<username>chris</username>
<password>chris-password</password>
</server>

Note: The <server> entries are not just used for scm servers. They are also used for maven repositories and other things as well.

permanent link
Chris Graham (367814) | answered Oct 09 '11, 11:24 p.m.
Hello. Back from a week with my boys. :-)

Hmmm. I've got vague recollections about this.

1. Is your local repo actually (/devit_home/users/bldfge/.m2/CMST) as set in your ~/.m2/settings.xml?
2. Does the file exist?
3. Is it corrupted?
4. Sometimes I think that the meta data can get broken, I'd delete/re-install the jar (along with it's meta data). Ie, mvn install:install-file ...

I need to get a working sample up i a VM to play with this properly.

-Chris

Hello Chris,

Thanks for the respose. I have tried to use the extensions attribute as suggested, but getting this error:

The plugin descriptor for the plugin Plugin was not found. Please verify that the plugin JAR /devit_home/users/bldfge/.m2/CMST/org/apache/maven/scm/maven-scm-provider-jazz/1.3/maven-scm-provider-jazz-1.3.jar is intact.
------------------------------------------------------------------------
Trace
java.lang.IllegalStateException: The plugin descriptor for the plugin Plugin was not found. Please verify that the plugin JAR /devit_home/users/bldfge/.m2/CMST/org/apache/maven/scm/maven-scm-provider-jazz/1.3/maven-scm-provider-jazz-1.3.jar is intact.

Any idea?

Appreciate your help.

Thanks
Sunil


permanent link
Chris Graham (367814) | answered Oct 10 '11, 8:31 p.m.
Hi All.

Ok. I've been able to replicate this. And indeed, my vague recollections did come back into sharp focus.

In short, you've done nothing wrong.

It is a bug in the way that the plugin has been built. You can not fix this.

David has too.

I've informed him of what the problem is, and how it needs to be fixed.

I've not heard back yet.

If I don't soon, I'll see what I can do about it.

-Chris

Hello. Back from a week with my boys. :-)

Hmmm. I've got vague recollections about this.

1. Is your local repo actually (/devit_home/users/bldfge/.m2/CMST) as set in your ~/.m2/settings.xml?
2. Does the file exist?
3. Is it corrupted?
4. Sometimes I think that the meta data can get broken, I'd delete/re-install the jar (along with it's meta data). Ie, mvn install:install-file ...

I need to get a working sample up i a VM to play with this properly.

-Chris

Hello Chris,

Thanks for the respose. I have tried to use the extensions attribute as suggested, but getting this error:

The plugin descriptor for the plugin Plugin was not found. Please verify that the plugin JAR /devit_home/users/bldfge/.m2/CMST/org/apache/maven/scm/maven-scm-provider-jazz/1.3/maven-scm-provider-jazz-1.3.jar is intact.
------------------------------------------------------------------------
Trace
java.lang.IllegalStateException: The plugin descriptor for the plugin Plugin was not found. Please verify that the plugin JAR /devit_home/users/bldfge/.m2/CMST/org/apache/maven/scm/maven-scm-provider-jazz/1.3/maven-scm-provider-jazz-1.3.jar is intact.

Any idea?

Appreciate your help.

Thanks
Sunil


permanent link
Scott Curry (11) | answered Dec 12 '11, 8:28 p.m.
Can anyone provide a status on releasing this plugin as open source and if/when it will be in the maven central repo?

Making the jazz-scm work with the maven-release-plugin is a must for many folks using maven for a long time and I am surprised IBM will not put more resources into resolving this within the jazz scm. Nearly every other SCM on the market will work (correctly) with the maven-release plugin including other DRCS like git.

Any information or update is appreciated.

Scott

permanent link
Chris Graham (367814) | answered Jan 02 '12, 11:14 p.m.
An update. I might back track on what i said above. <blush>

This is the right way to use a non-core SCM provider with the maven-scm-plugin. By non-core, I mean the providers that are not built with (and subsequenlty listed as dependencies of, the) maven-scm-plugin.


<build>
<plugins>
<!-- Add in the Jazz SCM Provider, so that it is known to the system. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.3</version>
<configuration>
<providerImplementations>
<jazz>jazz</jazz>
</providerImplementations>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-jazz</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
</plugin>


As for the other issues, eg the password in clear text in the scm lines in the pom and moving them to the more normal settings.xml location, that will require a code change. That code was introduced into a newer version (1.5 I think) of the maven-scm-plugin. So the jazz code will need to be modified and built against 1.5 as a minimum (1.6 has also been released).

-Chris


Hi All.

Ok. I've been able to replicate this. And indeed, my vague recollections did come back into sharp focus.

In short, you've done nothing wrong.

It is a bug in the way that the plugin has been built. You can not fix this.

David has too.

I've informed him of what the problem is, and how it needs to be fixed.

I've not heard back yet.

If I don't soon, I'll see what I can do about it.

-Chris

Hello. Back from a week with my boys. :-)

Hmmm. I've got vague recollections about this.

1. Is your local repo actually (/devit_home/users/bldfge/.m2/CMST) as set in your ~/.m2/settings.xml?
2. Does the file exist?
3. Is it corrupted?
4. Sometimes I think that the meta data can get broken, I'd delete/re-install the jar (along with it's meta data). Ie, mvn install:install-file ...

I need to get a working sample up i a VM to play with this properly.

-Chris

Hello Chris,

Thanks for the respose. I have tried to use the extensions attribute as suggested, but getting this error:

The plugin descriptor for the plugin Plugin was not found. Please verify that the plugin JAR /devit_home/users/bldfge/.m2/CMST/org/apache/maven/scm/maven-scm-provider-jazz/1.3/maven-scm-provider-jazz-1.3.jar is intact.
------------------------------------------------------------------------
Trace
java.lang.IllegalStateException: The plugin descriptor for the plugin Plugin was not found. Please verify that the plugin JAR /devit_home/users/bldfge/.m2/CMST/org/apache/maven/scm/maven-scm-provider-jazz/1.3/maven-scm-provider-jazz-1.3.jar is intact.

Any idea?

Appreciate your help.

Thanks
Sunil


permanent link
Chris Graham (367814) | answered Jan 10 '12, 7:22 a.m.
Alright. We have success!

Of a sort. Kind of.

It is workable. But it is not as smooth as the usual:


mvn -B release:prepare release:perform


that I normally use.

I've provided a very simple test project. It uses a pattern that I use quite often, namely, build a zip file of all listed dependencies. In this instance, I use only one, log4j. But the build bit of this project is not what we're interested in. We are interested in the SCM interactions with the Jazz SCM portion and the release plugin.

Here is the entire pom.xml file that I've been using:


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<!-- Specify the version of the POM. 4.0.0 is correct for Maven 2.x/3.x -->
<modelVersion>4.0.0</modelVersion>

<!-- Specify the coordinates of this version of this POM. -->
<groupId>jazz.test</groupId>
<artifactId>BogusTestJazz</artifactId>
<version>3.0.0.29-SNAPSHOT</version>
<packaging>pom</packaging>

<!-- Provide a short name and a meaningful description. -->
<name>BlahTestJazz</name>
<description>A simple, sample test project that builds a zip of dependencies. It is used to allow us to test the release processes for the maven-scm-provider-jazz.</description>

<!-- Specify the SCM settings. Used as part of the release process to create tags etc. -->
<scm>
<connection>scm:jazz:Deb;Deb@https://rtc:9444/jazz:BogusRepositoryWorkspace</connection>
<developerConnection>scm:jazz:Deb;Deb@https://rtc:9444/jazz:BogusRepositoryWorkspace</developerConnection>
</scm>

<!--
This is needed for the maven deploy phase.
It is using a file based repo as we don't have Archiva or a similar maven repo mgr present.
Normally, this is set in a parent or corporate pom.
In this case, we point them at C:\tmp\repo (both of them) as a temporary measure.
-->
<distributionManagement>
<!-- Use the following if you're not using a snapshot version. -->
<repository>
<id>release-repo</id>
<name>Release Repository Name</name>
<url>file:///C:/tmp/repo</url>
</repository>
<!-- Use the following if you ARE using a snapshot version. -->
<snapshotRepository>
<id>snapshot-repo</id>
<name>Snapshot Repository Name</name>
<url>file:///C:/tmp/repo</url>
</snapshotRepository>
</distributionManagement>

<!-- This is a simple project. It builds a zip file of all listed dependencies. -->
<!-- List all artefacts that you want included in the zip file here. -->
<!-- This list needs to be manually edited to set the specific versions of what you require. -->
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
</dependencies>

<!-- Specify the plugins used and their settings when a build (eg: mvn clean package) is performed. -->
<build>
<plugins>
<!-- Add in the Jazz SCM Provider, so that it is known to the system. -->
<!-- This is needed for the SCM commands to function. -->
<!-- Not needed as part of a normal build. Eg "mvn clean install" -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.3</version>
<configuration>
<providerImplementations>
<jazz>jazz</jazz>
</providerImplementations>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-jazz</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
</plugin>

<!-- Explicity list the maven-scm-provider-jazz as a dependency of -->
<!-- the maven-release-plugin so that it can be seen by the -->
<!-- maven-release-plugin. -->
<!-- Not needed as part of a normal build. Eg "mvn clean install" -->
<!-- Only needed when used as part of the release process. -->
<!-- Eg "mvn -B release:prepare" "mvn -B release:perform" etc -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.2</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-jazz</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
</plugin>

<!-- This the working part of a normal build. Eg "mvn clean install" -->
<!-- Use the assembly plugin to create a zip file of our dependencies -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>zip-for-release-no-deps.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>


So, you can build the zip file as per a normal maven build:


mvn clean install


As it stands, it will build: BogusTestJazz-3.0.0.29-SNAPSHOT.zip.

Now we come to the good bit.

The maven release processes. It works, but with a little manual intervention. The end result it the same, the maven release processes work.

In this example, I have created a Jazz SCM Component, called BogusTest. The eclipse/maven project BogusTest is checked into that component as the eclipse project. I've used the artifactId as BogusTestJazz (to differentiate it from another project, BogusTestSVN - for testing purposes for reference).

Firstly, we are able to execute the first stage of the maven release process:


mvn -B release:prepare


This does all of the normal things that the release plugin does. It transforms the poms, checks them in, creates the tag, re-transforms the poms again, and then checks them back into the SCM.

In this instance, a snapshot of ${artifactId}-${version} is created of the component. The version is then incremented, set back to a snapshot and then checked back in.


C:\CALMData\Workspaces\RTC\Deb\BogusTest>mvn -B release:prepare
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building BlahTestJazz
[INFO] task-segment: [release:prepare] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [release:prepare {execution: default-cli}]
[INFO] scmUrl - Deb;Deb@https://rtc:9444/jazz:BogusRepositoryWorkspace
[INFO] Scheme - https
[INFO] Verifying that there are no local modifications...
[INFO] ignoring changes on: pom.xml.releaseBackup, pom.xml.tag, pom.xml.branch, pom.xml.backup, release.properties, pom.xml.next
[INFO] scmUrl - Deb;Deb@https://rtc:9444/jazz:BogusRepositoryWorkspace
[INFO] Scheme - https
[INFO] Command line - cmd.exe /X /C "scm status --username Deb --password Deb --wide"
[INFO] err -
[INFO] Checking dependencies and plugins for snapshots ...
[INFO] scmUrl - Deb;Deb@https://rtc:9444/jazz:BogusRepositoryWorkspace
[INFO] Scheme - https
[INFO] Transforming 'BlahTestJazz'...
[INFO] scmUrl - Deb;Deb@https://rtc:9444/jazz:BogusRepositoryWorkspace
[INFO] Scheme - https
[INFO] Not generating release POMs
[INFO] Executing goals 'clean verify'...
[INFO] [INFO] Scanning for projects...
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building BlahTestJazz
[INFO] [INFO] task-segment: [clean, verify]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] [clean:clean {execution: default-clean}]
[INFO] [INFO] Deleting directory C:\CALMData\Workspaces\RTC\Deb\BogusTest\target
[INFO] [INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
[INFO] [INFO] [assembly:single {execution: make-assembly}]
[INFO] [INFO] Reading assembly descriptor: zip-for-release-no-deps.xml
[INFO] [INFO] Processing DependencySet (output=null)
[INFO] [INFO] Building zip: C:\CALMData\Workspaces\RTC\Deb\BogusTest\target\BogusTestJazz-3.0.0.29.zip
[INFO] [WARNING] Configuration options: 'appendAssemblyId' is set to false, and 'classifier' is missing.
[INFO] Instead of attaching the assembly file: C:\CALMData\Workspaces\RTC\Deb\BogusTest\target\BogusTestJazz-3.0.0.29.zip, it will become the file for main project artifact.
[INFO] NOTE: If multiple descriptors or descriptor-formats are provided for this project, the value of this file will be non-deterministic!
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD SUCCESSFUL
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 3 seconds
[INFO] [INFO] Finished at: Tue Jan 10 22:49:58 EST 2012
[INFO] [INFO] Final Memory: 16M/67M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] Checking in modified POMs...
[INFO] scmUrl - Deb;Deb@https://rtc:9444/jazz:BogusRepositoryWorkspace
[INFO] Scheme - https
[INFO] Command line - cmd.exe /X /C "scm status --username Deb --password Deb --wide"
[INFO] err -
[INFO] Command line - cmd.exe /X /C "scm checkin --username Deb --password Deb C:\CALMData\Workspaces\RTC\Deb\BogusTest\pom.xml"
[INFO] err -
[INFO] Tagging release with the label BogusTestJazz-3.0.0.29...
[INFO] scmUrl - Deb;Deb@https://rtc:9444/jazz:BogusRepositoryWorkspace
[INFO] Scheme - https
[INFO] Command line - cmd.exe /X /C "scm create snapshot --repository-uri https://rtc:9444/jazz --username Deb --password Deb --name BogusTestJazz-3.0.0.29 --description "[maven-release-plugin] copy for tag BogusTestJazz-3.0.0.29" BogusRepositoryWorkspace"
[INFO] err -
[INFO] Transforming 'BlahTestJazz'...
[INFO] scmUrl - Deb;Deb@https://rtc:9444/jazz:BogusRepositoryWorkspace
[INFO] Scheme - https
[INFO] Not removing release POMs
[INFO] Checking in modified POMs...
[INFO] scmUrl - Deb;Deb@https://rtc:9444/jazz:BogusRepositoryWorkspace
[INFO] Scheme - https
[INFO] Command line - cmd.exe /X /C "scm status --username Deb --password Deb --wide"
[INFO] err -
[INFO] Command line - cmd.exe /X /C "scm checkin --username Deb --password Deb C:\CALMData\Workspaces\RTC\Deb\BogusTest\pom.xml"
[INFO] err -
[INFO] Release preparation complete.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 33 seconds
[INFO] Finished at: Tue Jan 10 22:50:59 EST 2012
[INFO] Final Memory: 17M/68M
[INFO] ------------------------------------------------------------------------
C:\CALMData\Workspaces\RTC\Deb\BogusTest>


The important bit here is this SCM command to create the snapshot:


"scm create snapshot --repository-uri https://rtc:9444/jazz --username Deb --password Deb --name BogusTestJazz-3.0.0.29 --description "[maven-release-plugin] copy for tag BogusTestJazz-3.0.0.29" BogusRepositoryWorkspace"


There is two issues here.
1. Unlike other SCM's, the label/tag/baseline is not able to be checked out directly from a component in Jazz SCM. So we help it along it's way by creating a repository based upon the snapshot. This is done via:


scm create workspace BogusTestJazz-3.0.0.29 --repository-uri https://rtc:9444/jazz --username Deb --password Deb --snapshot BogusTestJazz-3.0.0.29


We now have a workspace called "BogusTestJazz-3.0.0.29" based on the "BogusTestJazz-3.0.0.29" snapshot of the original component BogusTest (yes, which really should have been called BogusTestJazz for consistency).
2. The pom.xml file has NOT had their SCM URL's transformed correctly. This is not right. I've written the appropriate JazzScmTranslator.java file that addresses this. This however, will need to be added to the maven-release-manager component, and thus commited to the apache project. It is simple, no IP here at all.
A simple work around of this is to manually edit the release.properties file and change the original repository workspace in the URL lines to that of the new one.
IE, we change:

#release configuration
#Tue Jan 10 22:50:59 EST 2012
scm.tagNameFormat=@{project.artifactId}-@{project.version}
scm.tag=BogusTestJazz-3.0.0.29
pushChanges=true
scm.url=scm\:jazz\:Deb;Deb@https\://rtc\:9444/jazz\:BogusRepositoryWorkspace
preparationGoals=clean verify
project.dev.jazz.test\:BogusTestJazz=3.0.0.30-SNAPSHOT
project.rel.jazz.test\:BogusTestJazz=3.0.0.29
remoteTagging=true
scm.commentPrefix=[maven-release-plugin]
project.scm.jazz.test\:BogusTestJazz.developerConnection=scm\:jazz\:Deb;Deb@https\://rtc\:9444/jazz\:BogusRepositoryWorkspace
project.scm.jazz.test\:BogusTestJazz.tag=HEAD
exec.snapshotReleasePluginAllowed=false
project.scm.jazz.test\:BogusTestJazz.connection=scm\:jazz\:Deb;Deb@https\://rtc\:9444/jazz\:BogusRepositoryWorkspace
completedPhase=end-release

to:

#release configuration
#Tue Jan 10 22:50:59 EST 2012
scm.tagNameFormat=@{project.artifactId}-@{project.version}
scm.tag=BogusTestJazz-3.0.0.29
pushChanges=true
scm.url=scm\:jazz\:Deb;Deb@https\://rtc\:9444/jazz\:BogusTestJazz-3.0.0.29
preparationGoals=clean verify
project.dev.jazz.test\:BogusTestJazz=3.0.0.30-SNAPSHOT
project.rel.jazz.test\:BogusTestJazz=3.0.0.29
remoteTagging=true
scm.commentPrefix=[maven-release-plugin]
project.scm.jazz.test\:BogusTestJazz.developerConnection=scm\:jazz\:Deb;Deb@https\://rtc\:9444/jazz\:BogusTestJazz-3.0.0.29
project.scm.jazz.test\:BogusTestJazz.tag=HEAD
exec.snapshotReleasePluginAllowed=false
project.scm.jazz.test\:BogusTestJazz.connection=scm\:jazz\:Deb;Deb@https\://rtc\:9444/jazz\:BogusTestJazz-3.0.0.29
completedPhase=end-release


That is a horrible hack to work around the missing code out of the maven-release-manager.

It also assists us in another issue with the maven-scm-provider-jazz plugin. The jazz provider does not honour the version parameter of the scmCheckout command so it will not create the appropriate SCM URL. By editing the release.properties file, we work around that limitation.

So, after all that, it brings us to the second step in the release process, namely, "mvn release:perform". Basically, what a release:perform does is to check out the appropriate tag from the SCM and then execute "mvn deploy" goal on it.

The final remaining issue, is that Jazz, like ClearCase and probably a few others, can not have (in Jazz terms) a sandbox within a sandbox.

We work around that little gem, by using the -DworkingDirectory parameter to point the check out directory (load in Jazz terms) to a location outside of the existing sandbox (normally, ./target/checkout - which violates the sandbox within a sandbox limitation).

So now we are ready to execute:


mvn -DworkingDirectory=C:\tmp\maven release:perform


The -DworkingDirectory can point anywhere, just not within a sandbox.

The results are as follows:


C:\CALMData\Workspaces\RTC\Deb\BogusTest>mvn -DworkingDirectory=C:\tmp\maven release:perform
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building BlahTestJazz
[INFO] task-segment: [release:perform] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [release:perform {execution: default-cli}]
[INFO] Checking out the project to perform the release ...
[INFO] scmUrl - Deb;Deb@https://rtc:9444/jazz:BogusTestJazz-3.0.0.29
[INFO] Scheme - https
[INFO] Command line - cmd.exe /X /C "scm load --repository-uri https://rtc:9444/jazz --username Deb --password Deb --force --dir C:\tmp\maven BogusTestJazz-3.0.0.29"
[INFO] err -
[INFO] Invoking perform goals in directory C:\tmp\maven\BogusTest
[INFO] Executing goals 'deploy'...
[WARNING] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[INFO] [INFO] Scanning for projects...
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building BlahTestJazz
[INFO] [INFO] task-segment: [deploy]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
[INFO] [INFO] Preparing source:jar
[INFO] [WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation.
[INFO] [INFO] No goals needed for project - skipping
[INFO] [INFO] [source:jar {execution: attach-sources}]
[INFO] [INFO] [javadoc:jar {execution: attach-javadocs}]
[INFO] [INFO] Not executing Javadoc as the project is not a Java classpath-capable package
[INFO] [INFO] [assembly:single {execution: make-assembly}]
[INFO] [INFO] Reading assembly descriptor: zip-for-release-no-deps.xml
[INFO] [INFO] Processing DependencySet (output=null)
[INFO] [INFO] Building zip: C:\tmp\maven\BogusTest\target\BogusTestJazz-3.0.0.29.zip
[INFO] [WARNING] Configuration options: 'appendAssemblyId' is set to false, and 'classifier' is missing.
[INFO] Instead of attaching the assembly file: C:\tmp\maven\BogusTest\target\BogusTestJazz-3.0.0.29.zip, it will become the file for main project artifact.
[INFO] NOTE: If multiple descriptors or descriptor-formats are provided for this project, the value of this file will be non-deterministic!
[INFO] [INFO] [install:install {execution: default-install}]
[INFO] [INFO] Installing C:\tmp\maven\BogusTest\pom.xml to C:\Documents and Settings\admin\.m2\repository\jazz\test\BogusTestJazz\3.0.0.29\BogusTestJazz-3.0.0.29.pom
[INFO] [INFO] [deploy:deploy {execution: default-deploy}]
[INFO] Uploading: file:///C:/tmp/repo/jazz/test/BogusTestJazz/3.0.0.29/BogusTestJazz-3.0.0.29.pom
[INFO] 4/5K
[INFO] 5/5K
[INFO] 5K uploaded (BogusTestJazz-3.0.0.29.pom)
[INFO] [INFO] Retrieving previous metadata from release-repo
[INFO] [INFO] Uploading repository metadata for: 'artifact jazz.test:BogusTestJazz'
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD SUCCESSFUL
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 8 seconds
[INFO] [INFO] Finished at: Tue Jan 10 23:13:39 EST 2012
[INFO] [INFO] Final Memory: 27M/101M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] Cleaning up after release...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21 seconds
[INFO] Finished at: Tue Jan 10 23:13:39 EST 2012
[INFO] Final Memory: 17M/69M
[INFO] ------------------------------------------------------------------------
C:\CALMData\Workspaces\RTC\Deb\BogusTest>


And that, warts and all, is how we can crank out Maven Releases with the existing maven-scm-provider-jazz:1.3 and the maven-release-plugin:2.2.2.

:-)

-Chris

PS: Clearly, there is still work to be done.
The jazz provider needs to be updated to allow userid/password to work from settings.xml.
It would be nice if it created the workspaces based on the snapshots (so it works more like the end results of the other scms).
The checkOut function needs to be able to understand the ScmVersion parameter passed to it (will also allow it to work with ScmBranches - more work here re streams)
And probably lots more than I've discovered yet... :-))))

permanent link
Ecker Sandor (46) | answered Jan 30 '12, 6:53 a.m.
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.

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.