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
Chris Graham (367814) | answered Jul 09 '13, 1:29 a.m.
I would not lock the poms. From the comments I left for myself in the jazz code itself, locking is discouraged and only recommended for binaries anyway.
If you're having regular clashes in pom changes and the release plugin you need to ask yourself why this is happening.

I've found out why the locks are not being released. The release manager does not call the unedit (ie unlock) at any point in time! I need to grok that before I submit a patch.

As for parallel development, it's simple. I use the versions-plugin.

Where I'd have a branch in git or svn, I have a stream in ClearCase and Jazz.
So I have a 1.x.y.z-SNAPSHOT for the R1 stream/branch and 2.x.y.z-SNAPSHOT for the R2 stream/branch.

Yes you will get some collisions, but that can be minimised through judicious use of the versions plugin before a merge.

If you are merging from R1 -> R2 (normal, and not a R2 -> R1 backport), do this:
- Set the R2 version to the incoming R1 version on a temporary basis
- Merge in. That will cater for any other changes in the pom
- Set the R2 version back to what it was.

To use:

mvn org.codehaus.mojo:versions-maven-plugin:set -DnewVersion=#.#.#.#-SNAPSHOT


permanent link
Oguzhan Ozavar (112) | answered Jul 08 '13, 8:00 a.m.
Hi Chris,

I am currently working on some other ALM improvements so I could not deal with that last week. We achieved our first milestone. Thank you for your comments. Do you have any suggestions on our M2 scenario?

M1 (Demo)
  • We are able to perform builds with autoincrementing version numbers and without locking resources.
  • We are able to upload resulting packages to the nexus repository.

We aim below scenario for our second milestone (Maven builds will be included in our release management process after that)

M2 (Real development scenario)
  • Fix the unlock resource issue in a custom way (Perhaps after waiting for your test results)
  • Put some version number logic for parallel development streams, ie; different projects on the same app. In fact I found a buildnumber plugin but it does not support jazz scm (only svn and git). Maybe we should find a way to include the workspace name and also an auto-incremented build number (which is stored in a common path for all parallel streams) in the version number.


Oğuzhan


permanent link
Oguzhan Ozavar (112) | answered Jun 28 '13, 9:01 a.m.
Main reason we need useEditMode argument is to prevent a conflict scenario which would be caused by a developer delivering pom.xml changes right after an automated build starts. In our RTC-Maven configuration, it does not seem to release the acquired locks as it does in SVN. Maybe the Unedit command in the jazz provider 1.8.1 is missing some implementation...

I tried below but still locks are not released...
  • removing preperation goals from pom.xml (as Chris pointed)
  • removing release:perform goal (to see if it still not release the locks without -DworkingDirectory parameter)

thanks in advance
Oguzhan



Comments
Chris Graham commented Jun 28 '13, 9:06 p.m.

The changes above were not to fix the locks, they were simply unnecessary.
I've draged out the VM that I did all of the RTC/Jazz development in, so I'll see if I can recreate the issue.

I did manually test the scm edit/unedit functionality from the command line. However, I was unaware that you could lock the poms as a part of the release, so I'll see what is going on.

-Chris


Chris Graham commented Jul 06 '13, 7:36 a.m.

I'm going to recomment on my own answer:

Upon reflection, it IS a good idea to put the preparation goals into the pom, as it provides better documentation as to how the release was prepared.

I normally simply use:

mvn -B -Dresume=false release:prepare release:perform

and have to add in -DworkingDirectory= for the jazz stuff.

So having it all in there is most probably a good thing.

-Chris


Chris Graham commented Mar 19 '14, 6:43 p.m.

I dug deeper, and found that it's not the maven scm jazz stuff at all. It's the maven release manager. It never calls the unlock functions! So, it would apprear that you're the first person (on the planet) to use it! :)

-Chris


permanent link
Chris Graham (367814) | answered Jun 25 '13, 6:00 a.m.
"Another issue is these temporary workspaces are not being deleted after build completion (which may cause redundant disk usage and some other problems)."

That's not an issue per-se, it is somethign that you will simply have to manage yourself.

I'd not use the locks, see how you go.

-Chris


Comments
Oguzhan Ozavar commented Jun 28 '13, 9:09 a.m.

Hi Chris,

Temporary workspaces (not the regular ones specified in the build definition) are created per build request, so that the numbers will increase fastly in a multibuild environment (like ours). Since these are called "temporary" artifacts, they should be deleted at the end of their execution context (imho). I think no one would like to manage these kind of manual workload. Locks are totally different story which I tried to explain in the next post.

ty and best regards


Chris Graham commented Jun 28 '13, 8:58 p.m.

Hey.

You mean "release request" not a "build request", which I'm assuming that you really mean snapshot builds.

We are talking about the release plugin's usage of the Jazz SCM provider here, so I'm assuming releases.

So I've got to ask the question, why are you burning though releases so quickly?

Currently, there is no support for deleting the release workspaces (V3 could not, but perhaps V4 might, I've not checked yet) from the SCM CLI tool, which is what the jazz provder acts as a wrapper for. So, if the functionality is not supplied by SCM(.exe) then I can not do it.

So, for the moment, you will need to clean these up manually.

And, if you're burning through 400 releases (ie workspaces) per day, I'd have to ask why???

-Chris


permanent link
Chris Graham (367814) | answered Jun 25 '13, 5:57 a.m.
Try this:

<plugin>
                <groupid>org.apache.maven.plugins</groupid>
                <artifactid>maven-release-plugin</artifactid>
                <version>2.4.1</version>
                <configuration>
                    <preparationgoals>clean verify -Dmaven.test.skip=true</preparationgoals>
                    <username>SDLCJazz</username>
                    <password>*****</password>
                </configuration>
</plugin>

Personally, I'd get right of the preparationgoals anyway - I've only ever used that from the command line (and you do not want the deploy at this step), that is what release:perform does.

the scm stuff is not needed to be listed separately, as the release plugin 2.4+ already has the right deps for the jazz stuff anyway.

and why are you using locks? I tested the lock acquire/release manually from the command line, but not as a part of the release process.

-Chris


permanent link
Oguzhan Ozavar (112) | answered Jun 13 '13, 12:20 p.m.
edited Jun 13 '13, 1:26 p.m.
Hi all,

Our maven2 build fails to release locks after release prepare completion. There is no error in the log file and the build results are successfull. We use useEditMode parameter which should be releasing the acquired locks implicitly at the end of the build. We also use workingDirectory parameter because of the load snapshot issue.

Locks are acquired successfully as seen below, however, i could not find any release lock attampt in the log file.

ANY COMMENTS??


EDIT: I found that the temporary workspaces created by maven-plugin-for-rtc to workarround the load sandbox issue, do not have their flow target stream set. Since the scm lock acquire command requires a repo ws with a valid flow target (see below documentation) I suspect the scm lock release command might be executing on that temp workspace. Another issue is these temporary workspaces are not being deleted after build completion (which may cause redundant disk usage and some other problems).

http://maven.apache.org/scm/maven-scm-providers/maven-scm-provider-jazz/
The implementation uses the scm lock acquire command, and uses the implicit flow targets defined for the repository workspace. If none are defined, the command will fail.



[DEBUG] Executing edit command...
[INFO] Executing: cmd.exe /X /C "scm lock acquire --repository-uri https://e2ertc.tt-tim.tr:9443/ccm --username SDLCJazz --password ***** D:\AVEA_CODE_WORK_AREA\crm\workspaces\ttg_musteri_riza_dev\com.avea.ttmusteririza\pom.xml"
[INFO] Working directory: D:\AVEA_CODE_WORK_AREA\crm\workspaces\ttg_musteri_riza_dev\com.avea.ttmusteririza
[DEBUG] Consumed line :Locks successfully acquired.

build definition and pending changes view

Here is the pom.xml

<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.avea.ttmusteririza</groupId>
    <artifactId>com.avea.ttmusteririza</artifactId>
    <version>0.0.36-SNAPSHOT</version>
    <name>com.avea.ttmusteririza</name>
    <description>TT - TTNet - Avea Musteri Rizasi Application</description>

    <scm>
        <connection>scm:jazz:SDLCJazz;5dlc.J@zz@https://e2ertc.tt-tim.tr:9443/ccm:CRM Sales Dev - TTG - R1 Development - vadiguzel Workspace</connection>
    </scm>
    <repositories>
        <repository>
            <id>public</id>
            <name>Public Repositories</name>
            <url>http://10.248.72.68:8081/nexus/content/repositories/public</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>public</id>
            <name>Public Repositories</name>
            <url>http://10.248.72.68:8081/nexus/content/repositories/public</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <updatePolicy>never</updatePolicy>
            </releases>
        </pluginRepository>
    </pluginRepositories>


    <distributionManagement>
        <repository>
            <id>releases</id>
            <url>http://10.248.72.68:8081/nexus/content/repositories/releases</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <url>http://10.248.72.68:8081/nexus/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <preparationGoals>clean deploy -Dmaven.test.skip=true</preparationGoals>
                    <goals>deploy -P release</goals>
                    <username>SDLCJazz</username>
                    <password>*****</password>
                    <releaseProfiles>release</releaseProfiles>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-jazz</artifactId>
                        <version>1.8.1</version>
                    </dependency>

                </dependencies>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>aspectj-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>test-compile</goal>
                        </goals>
                        <configuration>
                            <source>1.6</source>
                            <target>1.6</target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.apache.maven.surefire</groupId>
            <artifactId>surefire-junit4</artifactId>
            <version>2.4.3</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>10.2.0.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>dbunit-maven-plugin</artifactId>
            <version>1.0-beta-3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.dbunit</groupId>
            <artifactId>dbunit</artifactId>
            <version>2.4.8</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>sql-maven-plugin</artifactId>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>3.2.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>3.2.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>3.2.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>3.2.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>3.2.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>3.2.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>1.6.11</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjtools</artifactId>
            <version>1.6.2</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>1.6.11</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.2.2</version>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.7</version>
        </dependency>
        <dependency>
            <groupId>sshtools</groupId>
            <artifactId>j2ssh-core</artifactId>
            <version>0.2.9</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>
    </dependencies>
</project>

Comments
Oguzhan Ozavar commented Jun 13 '13, 12:22 p.m.

PS: Sory for the long post that I could not find how to post the long text within a scrolling textarea...


permanent link
Chris Graham (367814) | answered Jun 05 '13, 10:39 p.m.
edited Jun 25 '13, 6:02 a.m.
PA?

What, _exactly_ are you looking for here?
What do you need to happen?
As I can not make any sense of what you are asking for.

Please spell it out, ta.

-Chris


permanent link
Jason Gould (11) | answered Jun 05 '13, 9:08 a.m.

Hi there,

I have the plugin working fine, I do however have a query. My PA's are set to require an associated work item prior to deliver. Is there a way I can pass in a workitem number for the release plugin to use on a release:perform?

Thanks

Jason


Comments
Chris Graham commented Jun 25 '13, 6:01 a.m.

All Jazz SCM interaction is via the SCM(.exe) command.
If you can get that to work, then I can have a look at how you need to work with the maven plugin.
-Chris


Chris Graham commented Aug 16 '13, 2:32 a.m.

Hi Jason.

The WI that you need to pass in.
Is it static?
Does it change per release?

At it's simplest, I can associate a WI passed in via a -D.

Would that work?

-Chris


permanent link
Chris Graham (367814) | answered Jul 14 '12, 3:02 a.m.
Hi all.

The maven-release-plugin 2.3.2 has been released, which fixes a number of issues, some of which were Jazz SCM specific.

I recommend that 2.3 and 2.3.1 NOT be used. Use 2.3.2 instead.

-Chris


permanent link
Chris Graham (367814) | answered Jun 01 '12, 2:46 a.m.
The release plugin/manager 2.3.1 is now available in the central repository. Or should be.

Please use this for Jazz Maven work rather than the 2.3 release.

Enjoy.

-Chris

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.