Hello,

I think we already had that issue, the problem is that the url is not 
recognized if the scheme handler is not registered, which in turn happens if 
some dependencies are missing. Did you check JIRA, can’t remember if it’s still 
open or was closed.

I am not sure of this can be solved well in the error message (Maybe add „... 
or unknown schema“), but you can certainly add an assert in the testcase to 
ensure the schema is registered.

Gruss
Bernd
--
http://bernd.eckenfels.net
________________________________
Von: Benjamin Marwell <bmarw...@apache.org>
Gesendet: Sunday, April 25, 2021 1:24:23 PM
An: dev@commons.apache.org <dev@commons.apache.org>; Benjamin Marwell 
<bmarw...@apache.org>
Betreff: Re: [VFS] unexpected 'relative path' in verify.groovy

Okay,

the exact error message is:

Could not find file with URI
"tar:file:////home/user/git/apache/vfs-invoker-groovy/target/it/vfs-it/target/dependency/vfs-invoker-groovy-1.0.0-SNAPSHOT.tar!/hello.txt"
because it is a relative path, and no base URI was provided.

In fact, adding commons-compress solves this problem.
The error message is not helpful, I find it misleading. Would you
accept this as an issue?

Am Sa., 24. Apr. 2021 um 23:49 Uhr schrieb Benjamin Marwell
<bmarw...@apache.org>:
>
> Hi everyone,
>
> I think I figured part of it out myself.
> The wiki page 
> https://cwiki.apache.org/confluence/display/COMMONS/ExtractAndDecompressGzipFiles
> does not mention that commons-compress is needed in the classpath.
>
> The github project has some other flaws, too. I will put in some more work.
>
> Ben
>
> Am Sa., 24. Apr. 2021 um 23:22 Uhr schrieb Benjamin Marwell
> <bmarw...@apache.org>:
> >
> > Hi everyone,
> >
> > I tried to use vfs2 in a verify.groovy script like this:
> >
> >     def fsManager = VFS.manager
> >     def file = 
> > fsManager.resolveFile("gz:tar:${basedir}/target/dependencies/vfs-invoker-groovy-1.0.0-SNAPSHOT.tar!/hello.txt")
> >
> > While this works in a junit+groovy maven test case, it won’t in a
> > verify.groovy script called by the invoker plugin.
> > The exception message is:
> >
> >     org.apache.commons.vfs2.FileSystemException: Could not find file
> > with URI 
> > "tar:/home/user/git/apache/vfs-invoker-groovy/target/it/vfs-it/target/dependencies/vfs-invoker-groovy-1.0.0-SNAPSHOT.tar"
> > because it is a relative path, and no base URI was provided.
> >
> > This is odd, because as the junit test case shows, it is not a
> > relative path, and it does work in a junit+groovy test.
> >
> > I did set up an example repository here:
> > https://github.com/bmarwell/vfs2-verify-invoker
> >
> > run this command to get a build log:
> > $ mvn verify -Prun-its
> >
> > to get the build output on the command line:
> > $ mvn verify -Prun-its -DstreamLogs=true
> >
> > Note I haven’t yet added the groovy test case I mentioned.
> >
> > Please keep me in CC, as I am not a member of this list.
> >
> > Thanks,
> > Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to