Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use Paths that have spaces with jetty-ee10-maven-plugin #12000

Closed
joakime opened this issue Jul 3, 2024 · 3 comments · Fixed by #12003
Closed

Cannot use Paths that have spaces with jetty-ee10-maven-plugin #12000

joakime opened this issue Jul 3, 2024 · 3 comments · Fixed by #12003
Assignees
Labels
Bug For general bugs on Jetty side

Comments

@joakime
Copy link
Contributor

joakime commented Jul 3, 2024

Jetty version(s)
12.0.10

Jetty Environment
Any (just tested in ee10)

Java version/vendor (use: java -version)
Any

OS type/version
Any (tested in Unix)

Description
Create a webapp project in a path on unix that has a space.

/home/user/code/Project Foo/Admin WebApp/pom.xml

Now try to specify the <resourceBases> section using either ${basedir} or ${project.build.directory} in the jetty-ee10-maven-plugin
It will fail as the URI.create() will not like the raw space.

public void setResourceBases(String[] resourceBases)
{
try
{
// TODO: what happens if this is called more than once?
// This is a user provided list of configurations.
// We have to assume that mounting can happen.
List<URI> uris = Stream.of(resourceBases)
.map(URI::create)
.toList();
setBaseResource(this.getResourceFactory().newResource(uris));
}
catch (Throwable t)
{
throw new IllegalArgumentException("Bad resourceBases: [" + String.join(", ", resourceBases) + "]", t);
}
}

@joakime joakime added the Bug For general bugs on Jetty side label Jul 3, 2024
@joakime joakime changed the title Cannot use Paths with spaces with spaces with jetty-ee10-maven-plugin Cannot use Paths that have spaces with jetty-ee10-maven-plugin Jul 3, 2024
@joakime
Copy link
Contributor Author

joakime commented Jul 3, 2024

Also, this use of URI::create could be a problem on Windows.

@joakime
Copy link
Contributor Author

joakime commented Jul 3, 2024

@olamy is there any benefit to making CI checkout / clone to a directory with a space just to ensure there aren't other sneaking "directory with a space" issues in the codebase?

@joakime
Copy link
Contributor Author

joakime commented Jul 3, 2024

Opened PR #12001 to address this.

@olamy or @janbartel that is a Draft PR as I'm sure you both have opinions on it.
Please take over that branch / PR to make it the way you two envision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
No open projects
Status: ✅ Done
3 participants