You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ovidiu Feodorov <ov...@novaordis.com> on 2009/06/30 04:55:33 UTC
SCM SVN Provider fails on Windows with cygwin/svn because of "C:/"
prefix
I know this is not a new problem, I found several JIRA issues related to
it (SCM-213 <http://jira.codehaus.org/browse/SCM-213>, for example), all
reported "Resolved", but yet I am using Maven SCM 1.2 and the 2.0 Beta 9
release plug-in and , and I am still seeing it.
This is what happens in my case:
I am running mvn release:prepare for a multi-module project, (cygwin,
Windows) and the operation fails with:
[INFO] Checking in modified POMs...
[INFO] Executing: cmd.exe /X /C "svn --non-interactive commit --file
c:\Users\ovidiu\AppData\Local\Temp\maven-scm-1114844030.commit
--targets c:\Users\ovidiu\AppData\Local\Temp\maven-scm-59263-targets"
[INFO] Working directory:
c:\work\playground\maven\release-plugin-experiments
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Unable to commit files
Provider message:
The svn command failed.
Command output:
svn:
'/cygdrive/c/work/playground/maven/release-plugin-experiments/C:' is
not a working copy
svn: Can't open file
'/cygdrive/c/work/playground/maven/release-plugin-experiments/C:/.svn/entries':
No such file or directory
The temporary file maven-scm-xxxxx-targets contains
c:/work/playground/maven/release-plugin-experiments/pom.xml
C:/work/playground/maven/release-plugin-experiments/sub-module-one/pom.xml
which confuses svn. C:/work/playground/maven/release-plugin-experiments
is the correct project home, cygwin svn is bothered by the C:/ prefix.
It seems quite obvious that this could be handled by cygwin svn, but I
believe it could also be worked around from the Maven layer, with
minimum of effort, especially that Maven SCM already has Cygwin-related
configuration options. If Maven would generate maven-scm-xxxxx-targets
to contain cygwin paths Windows paths, that would quell svn.
The file list in maven-scm-xxxxx-targets is generated by
org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils.addTargets()
(https://svn.apache.org/repos/asf/maven/scm/tags/maven-scm-1.2/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/SvnCommandLineUtils.java).
SvnCommandLineUtils.addTargets() could take into consideration
Cygwin-related <svn-settings> (<useCygwinPath> and <cygwinMountPath>)
and build the paths accordingly. <useCygwinPath> and <cygwinMountPath>
are already there, and this was probably the hardest part (see
http://maven.apache.org/scm/subversion.html).
If you think this is a sensible solution that'll make the life of the
developers easier, and are willing to apply it, I'll submit the patch.
Or, it is also quite possible that I am totally missing something
obvious here, and I will be happy to be guided to the right path.
Cheers,
Ovidiu
Re: SCM SVN Provider fails on Windows with cygwin/svn because of
"C:/" prefix
Posted by Ovidiu Feodorov <ov...@novaordis.com>.
Hi Olivier, yes, I actually tried that, it does not help, see my
previous reply to the list (sent a couple of minutes ago) for an
explanation why. The answer is in
org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils.addTarget().
I'd change it to take into account the <useCygwinPath> setting, it
currently doesn't.
Olivier Lamy wrote:
> Did you have a look here : http://maven.apache.org/scm/subversion.html
>
> <useCygwinPath>true in order to use cygwin path /cygdrive/c</useCygwinPath>
> <cygwinMountPath>the mount path to use default is /cygwin</cygwinMountPath>
>
> Personnaly I use windows svn even if I use cygwin.
>
> --
> Olivier
>
> 2009/6/30 Ovidiu Feodorov <ov...@novaordis.com>:
>
>> I know this is not a new problem, I found several JIRA issues related to it
>> (SCM-213 <http://jira.codehaus.org/browse/SCM-213>, for example), all
>> reported "Resolved", but yet I am using Maven SCM 1.2 and the 2.0 Beta 9
>> release plug-in and , and I am still seeing it.
>>
>> This is what happens in my case:
>>
>> I am running mvn release:prepare for a multi-module project, (cygwin,
>> Windows) and the operation fails with:
>>
>> [INFO] Checking in modified POMs...
>> [INFO] Executing: cmd.exe /X /C "svn --non-interactive commit --file
>> c:\Users\ovidiu\AppData\Local\Temp\maven-scm-1114844030.commit
>> --targets c:\Users\ovidiu\AppData\Local\Temp\maven-scm-59263-targets"
>> [INFO] Working directory:
>> c:\work\playground\maven\release-plugin-experiments
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] BUILD FAILURE
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Unable to commit files
>> Provider message:
>> The svn command failed.
>> Command output:
>> svn:
>> '/cygdrive/c/work/playground/maven/release-plugin-experiments/C:' is
>> not a working copy
>> svn: Can't open file
>>
>> '/cygdrive/c/work/playground/maven/release-plugin-experiments/C:/.svn/entries':
>> No such file or directory
>>
>> The temporary file maven-scm-xxxxx-targets contains
>>
>> c:/work/playground/maven/release-plugin-experiments/pom.xml
>> C:/work/playground/maven/release-plugin-experiments/sub-module-one/pom.xml
>>
>>
>> which confuses svn. C:/work/playground/maven/release-plugin-experiments is
>> the correct project home, cygwin svn is bothered by the C:/ prefix.
>> It seems quite obvious that this could be handled by cygwin svn, but I
>> believe it could also be worked around from the Maven layer, with minimum of
>> effort, especially that Maven SCM already has Cygwin-related configuration
>> options. If Maven would generate maven-scm-xxxxx-targets to contain cygwin
>> paths Windows paths, that would quell svn.
>>
>> The file list in maven-scm-xxxxx-targets is generated by
>> org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils.addTargets()
>> (https://svn.apache.org/repos/asf/maven/scm/tags/maven-scm-1.2/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/SvnCommandLineUtils.java).
>>
>> SvnCommandLineUtils.addTargets() could take into consideration
>> Cygwin-related <svn-settings> (<useCygwinPath> and <cygwinMountPath>) and
>> build the paths accordingly. <useCygwinPath> and <cygwinMountPath> are
>> already there, and this was probably the hardest part (see
>> http://maven.apache.org/scm/subversion.html).
>>
>> If you think this is a sensible solution that'll make the life of the
>> developers easier, and are willing to apply it, I'll submit the patch.
>>
>> Or, it is also quite possible that I am totally missing something obvious
>> here, and I will be happy to be guided to the right path.
>>
>> Cheers,
>> Ovidiu
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
--
Ovidiu Feodorov
CEO
Nova Ordis LLC
650-255-0323
ovidiu@novaordis.com <ma...@novaordis.com>
Re: SCM SVN Provider fails on Windows with cygwin/svn because of
"C:/" prefix
Posted by Olivier Lamy <ol...@apache.org>.
Did you have a look here : http://maven.apache.org/scm/subversion.html
<useCygwinPath>true in order to use cygwin path /cygdrive/c</useCygwinPath>
<cygwinMountPath>the mount path to use default is /cygwin</cygwinMountPath>
Personnaly I use windows svn even if I use cygwin.
--
Olivier
2009/6/30 Ovidiu Feodorov <ov...@novaordis.com>:
>
> I know this is not a new problem, I found several JIRA issues related to it
> (SCM-213 <http://jira.codehaus.org/browse/SCM-213>, for example), all
> reported "Resolved", but yet I am using Maven SCM 1.2 and the 2.0 Beta 9
> release plug-in and , and I am still seeing it.
>
> This is what happens in my case:
>
> I am running mvn release:prepare for a multi-module project, (cygwin,
> Windows) and the operation fails with:
>
> [INFO] Checking in modified POMs...
> [INFO] Executing: cmd.exe /X /C "svn --non-interactive commit --file
> c:\Users\ovidiu\AppData\Local\Temp\maven-scm-1114844030.commit
> --targets c:\Users\ovidiu\AppData\Local\Temp\maven-scm-59263-targets"
> [INFO] Working directory:
> c:\work\playground\maven\release-plugin-experiments
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Unable to commit files
> Provider message:
> The svn command failed.
> Command output:
> svn:
> '/cygdrive/c/work/playground/maven/release-plugin-experiments/C:' is
> not a working copy
> svn: Can't open file
>
> '/cygdrive/c/work/playground/maven/release-plugin-experiments/C:/.svn/entries':
> No such file or directory
>
> The temporary file maven-scm-xxxxx-targets contains
>
> c:/work/playground/maven/release-plugin-experiments/pom.xml
> C:/work/playground/maven/release-plugin-experiments/sub-module-one/pom.xml
>
>
> which confuses svn. C:/work/playground/maven/release-plugin-experiments is
> the correct project home, cygwin svn is bothered by the C:/ prefix.
> It seems quite obvious that this could be handled by cygwin svn, but I
> believe it could also be worked around from the Maven layer, with minimum of
> effort, especially that Maven SCM already has Cygwin-related configuration
> options. If Maven would generate maven-scm-xxxxx-targets to contain cygwin
> paths Windows paths, that would quell svn.
>
> The file list in maven-scm-xxxxx-targets is generated by
> org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils.addTargets()
> (https://svn.apache.org/repos/asf/maven/scm/tags/maven-scm-1.2/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/SvnCommandLineUtils.java).
>
> SvnCommandLineUtils.addTargets() could take into consideration
> Cygwin-related <svn-settings> (<useCygwinPath> and <cygwinMountPath>) and
> build the paths accordingly. <useCygwinPath> and <cygwinMountPath> are
> already there, and this was probably the hardest part (see
> http://maven.apache.org/scm/subversion.html).
>
> If you think this is a sensible solution that'll make the life of the
> developers easier, and are willing to apply it, I'll submit the patch.
>
> Or, it is also quite possible that I am totally missing something obvious
> here, and I will be happy to be guided to the right path.
>
> Cheers,
> Ovidiu
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: SCM SVN Provider fails on Windows with cygwin/svn because of
"C:/" prefix
Posted by Ovidiu Feodorov <ov...@novaordis.com>.
Jörg Schaible wrote:
> The absolute paths are on purpose, see
> http://jira.codehaus.org/browse/SCM-368.
>
Can we make this configurable? <useRelativePaths>true</useRelativePaths>
or similar? I also annotated http://jira.codehaus.org/browse/SCM-368 ...
All my "Can we make this ..." questions on this list come with the
underlying pre-condition that I automatically volunteer to implement
whatever I propose.
Cheers,
Ovidiu
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: SCM SVN Provider fails on Windows with cygwin/svn because of
"C:/" prefix
Posted by Ovidiu Feodorov <ov...@novaordis.com>.
Jörg Schaible wrote:
> Ovidiu Feodorov wrote:
>
>
>> Jörg Schaible wrote:
>>
>
> [snip]
>
>
>>> What's the content
>>> of /cygdrive/c/Users/ovidiu/AppData/Local/Temp/maven-scm-45206-targets ?
>>>
>>>
>> I've pasted it in the previous e-mail. I am doing it again here:
>>
>> ---------------------------------------------------------------------------------------------------------
>> /cygdrive/c/work/playground/maven/release-plugin-experiments/pom.xml
>> /cygdrive/C/work/playground/maven/release-plugin-experiments/sub-module-one/pom.xml
>> ---------------------------------------------------------------------------------------------------------
>>
>
> Sorry, snipped too much ;-)
>
> The different case of the drive letter is irritating though ..
>
Yes, I noticed that too, I could find where it comes from ...
> [snip]
>
>>>
>>>
>>>> Could be a bug in svn, I don't know.
>>>>
>>>> $ svn --version
>>>> svn, version 1.5.4 (r33841)
>>>> compiled Oct 24 2008, 12:23:22
>>>>
>>>>
>>> or one of the Cygwin port of svn. Depends on the file content above.
>>>
>>>
>> Yes, most likely. As I said, I am not that ambitious to start looking
>> into SVN code.
>>
>
> Well, if you can provide a simple test case with Cyg svn only, you might
> report this on the Cygwin list. In such cases the package maintainer will
> normally have a look, there are some skilled people involved.
>
OK. I probably will.
>
>
>> If you believe my Maven workaround exposed above it's acceptable, I'll
>> implement it and submit the patch and tests.
>>
>
> Not up to me to decide anything here, I am simply a user that used to work
> with Cygwin/Java/Maven for years - untill I installed Linux on my office
> notebook in the end ;-)
>
>
Maybe one the deciders will hear our discussion and descend from a cloud
with a word of advice ...
>> If not, I'll continue to use my locally patched version, and avoid to
>> upgrade as much as possible :). Not a good policy, that's true, but this
>> thing is somewhere at position 127 on my stack, I am using Maven as tool
>> to build something else, and my primary loyalty in terms of time and
>> priorities, is to that "something else" :).
>>
>
> Me too :)
>
>
>> Anyway, I appreciate you replying, thank you for that.
>>
>
> Well, you did the work :)
>
Thanks
Re: SCM SVN Provider fails on Windows with cygwin/svn because of "C:/" prefix
Posted by Jörg Schaible <jo...@gmx.de>.
Ovidiu Feodorov wrote:
> Jörg Schaible wrote:
[snip]
>> What's the content
>> of /cygdrive/c/Users/ovidiu/AppData/Local/Temp/maven-scm-45206-targets ?
>>
>
> I've pasted it in the previous e-mail. I am doing it again here:
>
> ---------------------------------------------------------------------------------------------------------
> /cygdrive/c/work/playground/maven/release-plugin-experiments/pom.xml
> /cygdrive/C/work/playground/maven/release-plugin-experiments/sub-module-one/pom.xml
> ---------------------------------------------------------------------------------------------------------
Sorry, snipped too much ;-)
The different case of the drive letter is irritating though ..
[snip]
>>
>>> Could be a bug in svn, I don't know.
>>>
>>> $ svn --version
>>> svn, version 1.5.4 (r33841)
>>> compiled Oct 24 2008, 12:23:22
>>>
>>
>> or one of the Cygwin port of svn. Depends on the file content above.
>>
> Yes, most likely. As I said, I am not that ambitious to start looking
> into SVN code.
Well, if you can provide a simple test case with Cyg svn only, you might
report this on the Cygwin list. In such cases the package maintainer will
normally have a look, there are some skilled people involved.
> If you believe my Maven workaround exposed above it's acceptable, I'll
> implement it and submit the patch and tests.
Not up to me to decide anything here, I am simply a user that used to work
with Cygwin/Java/Maven for years - untill I installed Linux on my office
notebook in the end ;-)
> If not, I'll continue to use my locally patched version, and avoid to
> upgrade as much as possible :). Not a good policy, that's true, but this
> thing is somewhere at position 127 on my stack, I am using Maven as tool
> to build something else, and my primary loyalty in terms of time and
> priorities, is to that "something else" :).
Me too :)
> Anyway, I appreciate you replying, thank you for that.
Well, you did the work :)
Cheers,
Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: SCM SVN Provider fails on Windows with cygwin/svn because of
"C:/" prefix
Posted by Ovidiu Feodorov <ov...@novaordis.com>.
Jörg Schaible wrote:
> Ovidiu Feodorov wrote:
>
>> Jörg Schaible wrote:
>>
>>> So, do you say that Cygwin's svn has a problem if you call it directly on
>>> command line with an absolute path like
>>>
>>> svn info /cygpath/c/path/to/managed/source
>>>
>>> I can hardly believe this (cannot test it anymore, Windows free zone).
>>> The error above indicates for me that you actually called something like
>>>
>>> svn info /cygpath
>>>
>> I don't call svn directly, Maven does.
>>
>
> I know, but how should Maven work, if it does not work on your commandline?
> That's exaclty what I wanna know. If your command line works, then you can
> fix Maven. If not, then there's nothing to fix. ;-)
>
Command line fails when I use absolute paths.
Command line works when I use relative paths. If I were to use command
line with --target (which Maven does), I'd probably use relative paths,
it's more natural. Yes, I know, there's , so here's my proposal:
1. Expose a configuration option in SCM/SVN that will allow the user to
choose whether Maven creates --target file using absolute or relative paths.
2. By default, the configuration option is not explicitly declared, and
it defaults to "true" (use absolute paths), so nothing changes for the
majority of the users.
3. For cases like mine, I'd configure my environment to "false"
3.1 If I happen to stumble over long Windows paths with my "false" on,
then I am out of luck. I'll see what I do when I get there.
4. I document properly the option, so the users know they have this choice.
I don't claim to be the best solution, but it's a solution that works
for me, and won't impact anyone else if their configurations work for
them, and they don't change them. Basically, we're giving users options.
If they are well documented and appropriately provided with default
values, I don't see the harm.
> The thing is, that I can normally call svn from everywhere as long as the
> target path is managed by svn:
>
> /tmp $ svn info ~/src/Maven/plugins/maven-help-plugin/
>
> works for me although neither /tmp nor my home directory is obviously a svn
> working copy. However, the bug you see in Cygwin is a bit strange, because
> it means your svn looks also at the first path element ?!?
>
Yeah, I have no idea, I am not that ambitious to start looking into svn
source code :).
> [snip]
>
>
>> This is the result of running svn from command line, with the same
>> target files:
>>
>> $ svn ci -m "test" --targets
>> /cygdrive/c/Users/ovidiu/AppData/Local/Temp/maven-scm-45206-targets
>> svn: '/cygdrive' is not a working copy
>> svn: Can't open file '/cygdrive/.svn/entries': No such file or director
>>
>
> What's the content
> of /cygdrive/c/Users/ovidiu/AppData/Local/Temp/maven-scm-45206-targets ?
>
I've pasted it in the previous e-mail. I am doing it again here:
---------------------------------------------------------------------------------------------------------
/cygdrive/c/work/playground/maven/release-plugin-experiments/pom.xml
/cygdrive/C/work/playground/maven/release-plugin-experiments/sub-module-one/pom.xml
---------------------------------------------------------------------------------------------------------
> That file actually contains the real arguments ...
>
>
>> However, svn info works
>>
>> $ svn info
>> /cygdrive/c/work/playground/maven/release-plugin-experiments/pom.xml
>> Path: /cygdrive/c/work/playground/maven/release-plugin-experiments/pom.xml
>>
>
> [snip]
>
> Looks basically good.
>
>
>> Could be a bug in svn, I don't know.
>>
>> $ svn --version
>> svn, version 1.5.4 (r33841)
>> compiled Oct 24 2008, 12:23:22
>>
>
> or one of the Cygwin port of svn. Depends on the file content above.
>
Yes, most likely. As I said, I am not that ambitious to start looking
into SVN code.
If you believe my Maven workaround exposed above it's acceptable, I'll
implement it and submit the patch and tests.
If not, I'll continue to use my locally patched version, and avoid to
upgrade as much as possible :). Not a good policy, that's true, but this
thing is somewhere at position 127 on my stack, I am using Maven as tool
to build something else, and my primary loyalty in terms of time and
priorities, is to that "something else" :).
Anyway, I appreciate you replying, thank you for that.
Cheers,
Ovidiu
Re: SCM SVN Provider fails on Windows with cygwin/svn because of "C:/" prefix
Posted by Jörg Schaible <jo...@gmx.de>.
Ovidiu Feodorov wrote:
>
> Jörg Schaible wrote:
>> So, do you say that Cygwin's svn has a problem if you call it directly on
>> command line with an absolute path like
>>
>> svn info /cygpath/c/path/to/managed/source
>>
>> I can hardly believe this (cannot test it anymore, Windows free zone).
>> The error above indicates for me that you actually called something like
>>
>> svn info /cygpath
> I don't call svn directly, Maven does.
I know, but how should Maven work, if it does not work on your commandline?
That's exaclty what I wanna know. If your command line works, then you can
fix Maven. If not, then there's nothing to fix. ;-)
The thing is, that I can normally call svn from everywhere as long as the
target path is managed by svn:
/tmp $ svn info ~/src/Maven/plugins/maven-help-plugin/
works for me although neither /tmp nor my home directory is obviously a svn
working copy. However, the bug you see in Cygwin is a bit strange, because
it means your svn looks also at the first path element ?!?
[snip]
>
> This is the result of running svn from command line, with the same
> target files:
>
> $ svn ci -m "test" --targets
> /cygdrive/c/Users/ovidiu/AppData/Local/Temp/maven-scm-45206-targets
> svn: '/cygdrive' is not a working copy
> svn: Can't open file '/cygdrive/.svn/entries': No such file or director
What's the content
of /cygdrive/c/Users/ovidiu/AppData/Local/Temp/maven-scm-45206-targets ?
That file actually contains the real arguments ...
> However, svn info works
>
> $ svn info
> /cygdrive/c/work/playground/maven/release-plugin-experiments/pom.xml
> Path: /cygdrive/c/work/playground/maven/release-plugin-experiments/pom.xml
[snip]
Looks basically good.
> Could be a bug in svn, I don't know.
>
> $ svn --version
> svn, version 1.5.4 (r33841)
> compiled Oct 24 2008, 12:23:22
or one of the Cygwin port of svn. Depends on the file content above.
- Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: SCM SVN Provider fails on Windows with cygwin/svn because of
"C:/" prefix
Posted by Ovidiu Feodorov <ov...@novaordis.com>.
Jörg Schaible wrote:
> So, do you say that Cygwin's svn has a problem if you call it directly on
> command line with an absolute path like
>
> svn info /cygpath/c/path/to/managed/source
>
> I can hardly believe this (cannot test it anymore, Windows free zone). The
> error above indicates for me that you actually called something like
>
> svn info /cygpath
I don't call svn directly, Maven does. I've just modified
maven-scm-provider-svnexe-1.2.jar to generate absolute cygwin paths
based on .scm/svn-settings.xml. Here's my .scm/svn-settings.xml:
<svn-settings>
<useCygwinPath>true</useCygwinPath>
<cygwinMountPath>/cygdrive</cygwinMountPath>
</svn-settings>
This is what I get when I run mvn release:prepare:
[INFO] Checking in modified POMs...
[INFO] Executing: cmd.exe /X /C "svn --non-interactive commit --file
c:\Users\ovidiu\AppData\Local\Temp\maven-scm-1585775448.commit --targets
c:\Users\ovidiu\AppData\Local\Temp\maven-scm-45206-targets"
[INFO] Working directory:
c:\work\playground\maven\release-plugin-experiments
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Unable to commit files
Provider message:
The svn command failed.
Command output:
svn: '/cygdrive' is not a working copy
svn: Can't open file '/cygdrive/.svn/entries': No such file or directory
This is the content of the maven-scm-45206-targets file.
/cygdrive/c/work/playground/maven/release-plugin-experiments/pom.xml
/cygdrive/C/work/playground/maven/release-plugin-experiments/sub-module-one/pom.xml
This is the result of a neutral cygwin utility (copy and paste from
maven-scm-45206-targets):
$ file /cygdrive/c/work/playground/maven/release-plugin-experiments/pom.xml
/cygdrive/c/work/playground/maven/release-plugin-experiments/pom.xml:
ASCII English text, with CRLF line terminators
which tells me the path is correctly built.
This is the result of running svn from command line, with the same
target files:
$ svn ci -m "test" --targets
/cygdrive/c/Users/ovidiu/AppData/Local/Temp/maven-scm-45206-targets
svn: '/cygdrive' is not a working copy
svn: Can't open file '/cygdrive/.svn/entries': No such file or director
However, svn info works
$ svn info
/cygdrive/c/work/playground/maven/release-plugin-experiments/pom.xml
Path: /cygdrive/c/work/playground/maven/release-plugin-experiments/pom.xml
Name: pom.xml
URL:
svn+ssh://ovidiu@home.feodorov.com/home/svn/server/repos/playground/trunk/maven/release-plugin-experiments/pom.xml
Repository Root:
svn+ssh://ovidiu@example.com/home/svn/server/repos/playground
Repository UUID: 79ac6380-a99b-4678-936a-73d73a85994a
Revision: 453
Node Kind: file
Schedule: normal
Last Changed Author: ovidiu
Last Changed Rev: 452
Last Changed Date: 2009-07-02 07:43:37 -0700 (Thu, 02 Jul 2009)
Text Last Updated: 2009-07-02 07:43:18 -0700 (Thu, 02 Jul 2009)
Checksum: e7f7956c24d1b524bcce15a80a2d66e0
Could be a bug in svn, I don't know.
$ svn --version
svn, version 1.5.4 (r33841)
compiled Oct 24 2008, 12:23:22
Re: SCM SVN Provider fails on Windows with cygwin/svn because of "C:/" prefix
Posted by Jörg Schaible <jo...@gmx.de>.
Hi Ovidiu,
Ovidiu Feodorov wrote at Donnerstag, 2. Juli 2009 16:23:
>
>>
>> <svn-settings>
>> <useCygwinPath>true</useCygwinPath>
>> </svn-settings>
>>
>> [...]
>>
>> had no effect whatsoever when I first tried it, and then after looking
>> at
>>
https://svn.apache.org/repos/asf/maven/scm/tags/maven-scm-1.2/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/SvnCommandLineUtils.java,
>> I found out why, SvnCommandLineUtils, the code that generates the
>> content of the --targets file, doesn't even look at anything remotely
>> related to SCM configuration.
>>
>> It is just:
>> for ( Iterator i = files.iterator(); i.hasNext(); )
>> {
>> File f = (File) i.next();
>> sb.append( f.getPath().replace( '\\', '/' ) );
>> sb.append( ls );
>> }
>>
>> which dumps OS-dependent path representation into the text file.
>
> The actual solution is different from what I suggested above. Even if
> SvnCommandLineUtils.addTarget() generates cygwin-compliant absolute
> paths, svn chokes with:
>
> INFO] Unable to commit files
> Provider message:
> The svn command failed.
> Command output:
> svn: '/cygdrive' is not a working copy
> svn: Can't open file '/cygdrive/.svn/entries': No such file
> or directory
So, do you say that Cygwin's svn has a problem if you call it directly on
command line with an absolute path like
svn info /cygpath/c/path/to/managed/source
I can hardly believe this (cannot test it anymore, Windows free zone). The
error above indicates for me that you actually called something like
svn info /cygpath
> The way to make it work is to actually modify
> SvnCommandLineUtils.addTarget() to write relative paths in the target
> file. I have created a new JIRA issue
> (http://jira.codehaus.org/browse/SCM-481) and attached the patch there,
> in case the Maven team is interested in applying it. I haven't written
> tests, but if they want to apply it, I will write tests too.
The absolute paths are on purpose, see
http://jira.codehaus.org/browse/SCM-368.
> After applying the patch locally, release:prepare works great with
> cygwin SVN.
- Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: SCM SVN Provider fails on Windows with cygwin/svn because of
"C:/" prefix
Posted by Ovidiu Feodorov <ov...@novaordis.com>.
>
> <svn-settings>
> <useCygwinPath>true</useCygwinPath>
> </svn-settings>
>
> [...]
>
> had no effect whatsoever when I first tried it, and then after looking
> at
> https://svn.apache.org/repos/asf/maven/scm/tags/maven-scm-1.2/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/SvnCommandLineUtils.java,
> I found out why, SvnCommandLineUtils, the code that generates the
> content of the --targets file, doesn't even look at anything remotely
> related to SCM configuration.
>
> It is just:
> for ( Iterator i = files.iterator(); i.hasNext(); )
> {
> File f = (File) i.next();
> sb.append( f.getPath().replace( '\\', '/' ) );
> sb.append( ls );
> }
>
> which dumps OS-dependent path representation into the text file.
The actual solution is different from what I suggested above. Even if
SvnCommandLineUtils.addTarget() generates cygwin-compliant absolute
paths, svn chokes with:
INFO] Unable to commit files
Provider message:
The svn command failed.
Command output:
svn: '/cygdrive' is not a working copy
svn: Can't open file '/cygdrive/.svn/entries': No such file
or directory
The way to make it work is to actually modify
SvnCommandLineUtils.addTarget() to write relative paths in the target
file. I have created a new JIRA issue
(http://jira.codehaus.org/browse/SCM-481) and attached the patch there,
in case the Maven team is interested in applying it. I haven't written
tests, but if they want to apply it, I will write tests too.
After applying the patch locally, release:prepare works great with
cygwin SVN.
Re: SCM SVN Provider fails on Windows with cygwin/svn because of
"C:/" prefix
Posted by Ovidiu Feodorov <ov...@novaordis.com>.
Jörg Schaible wrote:
> Hi,
>
Hi, thanks for answering.
> Ovidiu Feodorov wrote at Dienstag, 30. Juni 2009 04:55:
>
> [snip]
>
>> It seems quite obvious that this could be handled by cygwin svn
>>
>
> No. Cygwin provides a POSIX layer for the file operations to allow unix
> utilities to compile and work in the Cygwin environment. Although some
> basic commands in Cygwin understand DOSish syntax, its up to the individual
> maintainer to patch that into the code and maintain this patch. Obviously
> this is no fun and normally not done.
>
One more reason to handle this at the Maven level, especially given the
fact that someone else bumped into similar problems and introduced
support for <useCygwinPath>.
> [...]
> IMHO the flag useCygwinPath should be enough. The implementation can
> determin the paths itself by executing "cygpath -u path" for each. The
> cygwinMountPath option is not a good choice, since it depends on the
> developer's environment and might not work at all if the path is on the
> network.
>
Yes, that's what I thought too, but
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
<svn-settings>
<useCygwinPath>true</useCygwinPath>
</svn-settings>
</configuration>
</plugin>
had no effect whatsoever when I first tried it, and then after looking
at
https://svn.apache.org/repos/asf/maven/scm/tags/maven-scm-1.2/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/SvnCommandLineUtils.java,
I found out why, SvnCommandLineUtils, the code that generates the
content of the --targets file, doesn't even look at anything remotely
related to SCM configuration.
It is just:
for ( Iterator i = files.iterator(); i.hasNext(); )
{
File f = (File) i.next();
sb.append( f.getPath().replace( '\\', '/' ) );
sb.append( ls );
}
which dumps OS-dependent path representation into the text file (yes,
changing backslashes into forward slashes, but this doesn't help with "C:".
This is where I would to try to patch.
If I have time tomorrow, I'll actually write the patch and see if it works.
Re: SCM SVN Provider fails on Windows with cygwin/svn because of "C:/" prefix
Posted by Jörg Schaible <jo...@gmx.de>.
Hi,
Ovidiu Feodorov wrote at Dienstag, 30. Juni 2009 04:55:
[snip]
> It seems quite obvious that this could be handled by cygwin svn
No. Cygwin provides a POSIX layer for the file operations to allow unix
utilities to compile and work in the Cygwin environment. Although some
basic commands in Cygwin understand DOSish syntax, its up to the individual
maintainer to patch that into the code and maintain this patch. Obviously
this is no fun and normally not done.
> , but I
> believe it could also be worked around from the Maven layer, with
> minimum of effort, especially that Maven SCM already has Cygwin-related
> configuration options. If Maven would generate maven-scm-xxxxx-targets
> to contain cygwin paths Windows paths, that would quell svn.
>
> The file list in maven-scm-xxxxx-targets is generated by
>
org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils.addTargets()
>
(https://svn.apache.org/repos/asf/maven/scm/tags/maven-scm-1.2/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/SvnCommandLineUtils.java).
>
> SvnCommandLineUtils.addTargets() could take into consideration
> Cygwin-related <svn-settings> (<useCygwinPath> and <cygwinMountPath>)
> and build the paths accordingly. <useCygwinPath> and <cygwinMountPath>
> are already there, and this was probably the hardest part (see
> http://maven.apache.org/scm/subversion.html).
>
> If you think this is a sensible solution that'll make the life of the
> developers easier, and are willing to apply it, I'll submit the patch.
>
> Or, it is also quite possible that I am totally missing something
> obvious here, and I will be happy to be guided to the right path.
IMHO the flag useCygwinPath should be enough. The implementation can
determin the paths itself by executing "cygpath -u path" for each. The
cygwinMountPath option is not a good choice, since it depends on the
developer's environment and might not work at all if the path is on the
network.
- Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org