You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by Jean-Christophe Lagache <jc...@gmail.com> on 2008/10/17 15:06:28 UTC

Rational ClearCase and Maven project

This mail contains the problems i found integrating ClearCase with my maven
project.
It also contains an issue request concerning the release-plugin
This also can be a base document for people want to do the same thing.

Configuration :
Maven 2.0.8
Java 1.4.2_15
Rational ClearCase LT 7.0.0
Rational ClearCase LT 7.0.0.0_iFix01
Rational ClearCase LT 7.0.0.0_iFix02
cleartool 7.0.0.0 (Tue Apr 25 21:37:50  2006)

I've got a ClearCase project called *myProject *which contains 2 ClearCase
components *myModule1 *and *myModule2*.
My ClearCase view is physically located at *C:\views\myProject*.
>From a maven point of view, there is 2 projects located at *
C:\views\myProject\myModule1* and *C:\views\myProject\myModule2*.
I want to integrate ClearCase to *myModule1 *project.

1) Integration of the maven scm plugin
pom.xml :
*<scm>
        <connection>scm:clearcase:load \myModule1</connection>
        <developerConnection>
            scm:clearcase:load \myModule1
        </developerConnection>
</scm>*

*>mvn scm:bootstrap
[ERROR] cleartool: Error: Unrecognized command option: "-vw*

ClearCase is the LT version so, create the file *$user.home
/.scm/clearcase-settings.xml* :
*<clearcase-settings>
    <useVWSParameter>false</useVWSParameter>
    <clearcaseType>LT</clearcaseType>
</clearcase-settings>*

*>mvn scm:bootstrap
[ERROR] cleartool: Error: A view cannot be created under another view's
storage
directory or snapshot view storage directory.*

That's right, *C:\views\myProject\myModule1* is a view storage.
pom.xml :
*<plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-scm-plugin</artifactId>
       <configuration>
            <checkoutDirectory>
                        ..\..\${artifactId}-${version}
             </checkoutDirectory>
       </configuration>
</plugin>*

*>mvn scm:bootstrap*
OK

2) Integration of the maven release plugin
pom.xml :
<distributionManagement>
     <repository>
            <uniqueVersion>false</uniqueVersion>
            <id>myModule1-releases</id>
            <url>dav:http://server/myModule1/repository</url>
        </repository>
        <site>
         <id>myModule1-site</id>
         <url>dav:http://server</url>
      </site>
      <snapshotRepository>
          <uniqueVersion>false</uniqueVersion>
          <id>myModule1--snapshots</id>
          <url>dav:http://server/myModule1/repository</url>
      </snapshotRepository>
</distributionManagement>
 ...
*<extensions>
  <extension>
    <groupId>org.apache.maven.wagon</groupId>
    <artifactId>wagon-webdav</artifactId>
  </extension>
</extensions>**

>mvn **release:perform*
*[INFO] Executing: C:\views\myProject\myModule1\target>>cmd.exe /X /C
"cleartool m
kview -snapshot -tag jclagache-HP12258259301-maven-checkout C:\**views**\**
myProject**\**myModule1**\target\checkout"
[ERROR] Provider message:
[ERROR] The cleartool command failed.
[ERROR] Command output:
[ERROR] cleartool: Error: A view cannot be created under another view's
storage
directory or snapshot view storage directory.*

This is the same problem as with the scm plugin.
The release plugin don't care about the checkoutDirectory from the scm
plugin.

*Issue : Can't the release plugin re-use the checkoutDirectory from the scm
plugin or can't the release:perform goal propose a checkoutDirectory
directory ?*

The only solution is to change the *workingDirectory *property for this
plugin in the pom.xml :
*<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-release-plugin</artifactId>
  <configuration>
    <workingDirectory>..\..\${artifactId}-${version}</workingDirectory>
  </configuration>
</plugin>*

*>mvn **release:perform
**[INFO] Executing: mvn deploy site-deploy --no-plugin-updates -P
env-testleh -DperformRelease=true
[INFO] Scanning for projects...
        [INFO]
------------------------------------------------------------------------
        [INFO] Building Maven Default Project
        [INFO]    task-segment: [deploy, site-deploy]
        [INFO]
------------------------------------------------------------------------
        [INFO]
------------------------------------------------------------------------
        [ERROR] BUILD ERROR
        [INFO]
------------------------------------------------------------------------
        [INFO] Cannot execute mojo: resources. It requires a project with an
existing pom.xml, but the build is not using one.
*
In fact the working directory is also now *..\..\${artifactId}-${version} *for
the deploy plug-in ...
pom.xml  :
* <plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-deploy-plugin</artifactId>
  <configuration>
    <workingDirectory>..\${project.build.directory}</workingDirectory>
  </configuration>
</plugin>*

*>mvn **release:perform
*OK*
*
Sorry for my poor english and this long mail for an only one issue request.
Maybe this mail will be usefull for one who want to integrate ClearCase with
their maven projects.