Greetings

It's been a few weeks, but I've finally gotten around to working on my 
custom provider. I am trying to get the absolute minimum framework 
written, after which I will have a contractor do the heavy lifting. I 
though it might be good to write just enough code to connect to the 
repository, but thought I'd make the "discovery" process work first, so 
here's what Ive got. I know it isn't much but until the discovery portion 
works, the rest of the code can't really be tested.

The provider
=================
package com.ph.buildtools.scm.provider;

// imports removed for brevity

/**
 * @plexus.component role="org.apache.maven.scm.provider.ScmProvider" 
role-hint="aci"
 **/

public class CustomScmProvider extends AbstractScmProvider {

    public ScmProviderRepository makeProviderScmRepository(String url, 
char delimiter)
        throws ScmRepositoryException {

        return new CustomScmProviderRepository();
    }

    public String getScmType() {
        return "aci";
    }
}

The repository
============

package com.ph.buildtools.scm.repository;

// imports removed for brevity

/**
 * Contains the repository information.
 **/

public class CustomScmProviderRepository extends 
ScmProviderRepositoryWithHost {

    public CustomScmProviderRepository() {}
}

The POM
==============
<project>
  <description>An ACI provider for SCM using Starteam SDK</description>
  <name>scm</name>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.ph.buildtools.plugins</groupId>
  <artifactId>scm-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  <parent>
    <groupId>com.ph.buildtools.pom</groupId>
    <artifactId>plugin</artifactId>
    <version>7.4.0.0</version>
  </parent>
  <scm>
    <connection>scm:aci:username:password</connection>
  </scm>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.apache.maven.scm</groupId>
      <artifactId>maven-scm-api</artifactId>
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>com.ph.buildtools.plugins</groupId>
      <artifactId>resources-plugin</artifactId>
      <version>7.4.0.0</version>
    </dependency>
  </dependencies>
</project>

And finally --> the output
====================
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'scm'.
[INFO] 
----------------------------------------------------------------------------
[INFO] Building scm
[INFO]    task-segment: [scm:validate] (aggregator-style)
[INFO] 
----------------------------------------------------------------------------
[INFO] Preparing scm:validate
[INFO] No goals needed for project - skipping
[INFO] [scm:validate]
[ERROR] Validation of scm url connection (connectionUrl) failed :
[ERROR] No such provider installed 'aci'.
[ERROR] The invalid scm url connection: 'scm:aci:username:password'.
[INFO] 
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] 
------------------------------------------------------------------------
[INFO] Command failed. Bad Scm URL.
[INFO] 
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] 
------------------------------------------------------------------------
[INFO] Total time: 6 seconds
[INFO] Finished at: Fri Oct 19 21:44:25 EDT 2007
[INFO] Final Memory: 7M/30M
[INFO] 
------------------------------------------------------------------------

Thanks
Robert Egan

This email message and any attachments may contain confidential, 
proprietary or non-public information.  The information is intended solely 
for the designated recipient(s).  If an addressing or transmission error 
has misdirected this email, please notify the sender immediately and 
destroy this email.  Any review, dissemination, use or reliance upon this 
information by unintended recipients is prohibited.  Any opinions 
expressed in this email are those of the author personally.

Reply via email to