maven-scm-users mailing list archives

Hi there,
I'm trying to use scm to export an XML Schema from cvs to generate
source code from it. As of now I can export the file but there are some
weirdnesses that keep me from using it in a real world application.
I use the following plugin configuration to export via scm:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.1</version>
<configuration>
<!--<basedir>.</basedir>-->
<connectionType>custom</connectionType>
<!--<workingDirectory>.</workingDirectory>-->
<exportDirectory>target\exported-sources\xsd</exportDirectory>
<connectionUrl>
scm:cvs:pserver:user:password@host:/data/cvsroot/repository:my/schema/di
rectory/in/cvs
</connectionUrl>
<developerConnectionUrl>
scm:cvs:pserver:user:password@host:/data/cvsroot/repository:my/schema/di
rectory/in/cvs
</developerConnectionUrl>
<scmVersion>MY_BRANCH</scmVersion>
<scmVersionType>branch</scmVersionType>
<includes>schema.xsd</includes>
</configuration>
<executions>
<execution>
<id>Export schema files for generation</id>
<goals>
<goal>export</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
</plugin>
The scm plugin is configured to execute its export goal automatically in
the initialize phase. I set both a connectionUrl and a
developerConnectionUrl because the repository I want to export from has
nothing to do with the repository used for my project. Therefore I also
set the connectionType to "custom". Configuring the scmVersion and
scmVersionType seem to work well, too.
With the configuration above the build will succeed and the relevant
output from saying mvn initialize would be something like:
[INFO] Executing: cmd.exe /X /C "cvs -z3 -f -d
:pserver:user:password@host:/dat
a/cvsroot/repository:my/schema/directory/in/cvs -q export -rMY_BRANCH -d
target
\exported-sources\xsd "my/schema/directory/in/cvs""
[INFO] Working directory: C:\checkout\myproj\target\exported-sources\xsd
The exported file will end up in
target/exported-sources/xsd/target/exported-sources/xsd instead of
target/exported-sources/xsd where I wanted them.
And this is where I don't understand the configuration any more:
(1) Whatever I do, when I use slashes instead of backslashes in
exportDirectory the build will fail. I'm on windows, so backslashes are
fine for me, but I thought to be cross platform compatible slashes would
be appropriate.
(2) Although basedir is not optional I can omit it with no problems.
Whatever value I set it to, it does not seem to get used anyway. Which
information should this parameter actually convey?
(3) The same for workingDirectory. It does not seem to get used either.
(4) The value from exportDirectory seems to get used twice, firstly as
the value -d parameter for the cvs command and secondly to chdir to the
working directory as can be seen from the second info message. This
might be the reason for the duplicated output directory structure.
Is there a bug in the cvs provider that causes the exportDirectory to be
used twice? Am I missing something? Or am I simply abusing the scm
plugin for things that I can't expect to work?
Any help will be highly appreciated.
Best Regards
Paul