When creating a project directory with a space in it, native compilation fails, see steps to reproduce below:
mkdir "dir with space"
cd dir with space/
mvn io.quarkus:quarkus-maven-plugin:0.12.0:create
-DprojectGroupId=quarkus.io
-DprojectArtifactId=space-quickstart
-DprojectVersion=1.0-SNAPSHOT
-DclassName="io.quarkus.SpaceResource"
mvn compile quarkus:dev
mvn package -Pnative
The following fixes the issue:
mv dir with space/ dir_with_space/
This seems related to #1402/#1607/#1438/#1030/etc.
The first error is Error: Class initialization failed: io.quarkus.undertow.runtime.graal.URLResourceSubstitution$ResourceInfo
Caused by: java.io.FileNotFoundException: /Users/rsvoboda/tmp/dir%20with%20space/target/lib/io.smallrye.smallrye-config-1.3.5.jar (No such file or directory) in my case.
I see same error when the root directory is named:
For the following cases I have successful run of compilation + dev mode + native build
With app?dir case I don't get through package phase
14:55:46 [INFO]
14:55:46 [INFO] --- quarkus-maven-plugin:999-SNAPSHOT:build (default) @ space-quickstart ---
14:55:46 [INFO] ------------------------------------------------------------------------
14:55:46 [INFO] BUILD FAILURE
14:55:46 [INFO] ------------------------------------------------------------------------
14:55:46 [INFO] Total time: 7.579 s
14:55:46 [INFO] Finished at: 2019-03-27T14:55:46+01:00
14:55:46 [INFO] ------------------------------------------------------------------------
14:55:46 [ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:
build (default) on project space-quickstart: Failed to build a runnable JAR:
Failed to build a runner jar: URI has a query component -> [Help 1]
Again it's going to be wrong URI handling somewhere.
Here's the rules for class paths:
MANIFEST.MF Class-Path is a list of relative URIs. A relative URI is not a relative directory, it's a URI without a scheme (see the RFC).C:\foo\bar.jar must have a leading slash when included in a Class-Path, like this: /C:/foo/bar. This happens by default when you use URI#getRawPath as described below. Note that when specifying paths in a CLASSPATH or -classpath, you must not use the leading / before the drive letter!URI.toAsciiString() as this will URI-encode and UTF-8 encode the whole URI).file scheme. Some JDKs don't allow URIs with any scheme including file. Make sure the URI is relative before encoding it. I think that simply using the raw path will just about always suffice.Path.toUri(). If you're just pulling the raw path, no further conversion is necessary.Path, use Paths.get(URI). Nice and easy.File, use Path.toFile().If you are not adhering to these rules, please include copious documentation explaining your rationale!
I'll update all related issues to reference this comment.
This seems related to #1402/#1607/#1438/#1030/etc.
Can this issue be closed? Looks like all the related issues have been closed.
Yes, I think so. Thanks.
Most helpful comment
Again it's going to be wrong URI handling somewhere.
Here's the rules for class paths:
MANIFEST.MFClass-Pathis a list of relative URIs. A relative URI is not a relative directory, it's a URI without a scheme (see the RFC).C:\foo\bar.jarmust have a leading slash when included in aClass-Path, like this:/C:/foo/bar. This happens by default when you useURI#getRawPathas described below. Note that when specifying paths in aCLASSPATHor-classpath, you must not use the leading/before the drive letter!URI.toAsciiString()as this will URI-encode and UTF-8 encode the whole URI).filescheme. Some JDKs don't allow URIs with any scheme includingfile. Make sure the URI is relative before encoding it. I think that simply using the raw path will just about always suffice.Path.toUri(). If you're just pulling the raw path, no further conversion is necessary.Path, usePaths.get(URI). Nice and easy.File, usePath.toFile().If you are not adhering to these rules, please include copious documentation explaining your rationale!
I'll update all related issues to reference this comment.