1

I am trying to checkout code from svn. I have written a pom.xml to do the same. Below is my code.

<scm>
    <connection>scm:svn:http://10.6.15.103/svn/PLM_Windchill_MidMarket/PLM_Windchill_MidMarket</connection>
    <developerConnection>scm:svn:http://10.6.15.103/svn/PLM_Windchill_MidMarket/PLM_Windchill_MidMarket</developerConnection>
</scm>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-scm-plugin</artifactId>
            <version>1.7</version>
            <configuration>
                <checkoutDirectory>${project.basedir}/src/svn</checkoutDirectory>
                <workingDirectory>${project.basedir}/src/svn</workingDirectory>
            </configuration>
        </plugin>
    </plugins>
</build>

when i run mvn scm:checkout install, I get the below error:

 Failed to execute goal org.apache.maven.plugins:maven-scm-plugin:1.7:checkout (default-cli) on project test_project1: Cannot run checkout command : Can't load the scm provider. Guice provision errors:

 1) Error in custom provider, java.lang.TypeNotPresentException: Type org.apache.maven.scm.provider.cvslib.cvsjava.CvsJavaScmProvider not present
 at ClassRealm[plugin>org.apache.maven.plugins:maven-scm-plugin:1.7, parent: sun.misc.Launcher$AppClassLoader@5acac268]
 at ClassRealm[plugin>org.apache.maven.plugins:maven-scm-plugin:1.7, parent: sun.misc.Launcher$AppClassLoader@5acac268]
 while locating org.apache.maven.scm.provider.ScmProvider annotated with @com.google.inject.name.Named(value=cvs)

 1 error: org/apache/maven/scm/provider/cvslib/AbstractCvsScmProvider: org.apache.maven.scm.provider.cvslib.AbstractCvsScmProvider

May I know how to resolve this problem?

Dmitry
  • 2,943
  • 1
  • 23
  • 26
galme
  • 603
  • 3
  • 10
  • 24
  • This example could help: http://stackoverflow.com/a/9992528/6309 – VonC Jul 23 '13 at 06:07
  • NO I still get the same error :( – galme Jul 23 '13 at 06:33
  • I tried your plugin configuration with a repository I have. It works. Seems like your repository url response is defect and maven interprets it as CVS. Have you tried to browse the URL in your web browser? It should be accessible without a password or you have to specify it in your maven settings. – Marc von Renteln Jul 23 '13 at 07:43

1 Answers1

0

Looks like you might have hit on this bug: https://bugzilla.redhat.com/show_bug.cgi?id=962273#c1

In the bug it suggests using the cvs_native implementation instead of the Java implementation. You can do this by changing your plugin configuration as follows:

<project>
    ...
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-plugin</artifactId>
                <version>1.7</version>
                <configuration>
                    <providerImplementations>
                        <cvs>cvs_native</cvs>
                    </providerImplementations>
                </configuration>
            </plugin>
        </plugins
    </build>
</project>

Also as a side note the latest version of the scm plugin is 1.8.1, maybe moving to the newest version will solve your problem.

DB5
  • 13,553
  • 7
  • 66
  • 71
  • I think the format of the target is SVN cause he used. `scm:svn:`. If the target is CVS then the whole scm format is wrong. – Marc von Renteln Jul 23 '13 at 08:51
  • My target is svn . Not CVS – galme Jul 23 '13 at 09:02
  • ANd what is svn-settings.xml? Should I do any changes in that xml file? – galme Jul 23 '13 at 09:06
  • @gouthami, do you have an svn client installed on your machine? Does a plain `svn checkout http://10.6.15.103/svn/PLM_Windchill_MidMarket/PLM_Windchill_MidMarket /localdir` work from the command line? As this is basically what maven will attempt to do, would be interesting to know if it works without using maven. – DB5 Jul 23 '13 at 09:35
  • I have installed TortoiseSVN om my system.I am not able to execute svn checkout on my command prompt – galme Jul 23 '13 at 10:18
  • TortoiseSVN doesn't come with a svn executable i guess – galme Jul 23 '13 at 10:19
  • @gouthami, unfortunately TortoiseSVN doesn't come with an SVN command line client. From their web page _It's intuitive and easy to use, since it doesn't require the Subversion command line client to run._ You'll need to install a command line client to have maven work correctly. In your case because maven can't find an SVN client it is defaulting to the Java CVS client which is then causing the error you are seeing. – DB5 Jul 23 '13 at 10:45