diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/MavenParser.java b/rewrite-maven/src/main/java/org/openrewrite/maven/MavenParser.java index 20769763b48..eef8f1f0e2d 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/MavenParser.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/MavenParser.java @@ -191,7 +191,7 @@ public Builder mavenConfig(@Nullable Path mavenConfig) { if (mavenConfig != null && mavenConfig.toFile().exists()) { try { String mavenConfigText = new String(Files.readAllBytes(mavenConfig)); - Matcher matcher = Pattern.compile("(?:$|\\s)-P\\s+([^\\s]+)").matcher(mavenConfigText); + Matcher matcher = Pattern.compile("(?:$|\\s)-P\\s+(\\S+)").matcher(mavenConfigText); if (matcher.find()) { String[] profiles = matcher.group(1).split(","); return activeProfiles(profiles); diff --git a/rewrite-maven/src/test/java/org/openrewrite/maven/MavenParserTest.java b/rewrite-maven/src/test/java/org/openrewrite/maven/MavenParserTest.java index 71e140589af..b8f02409f6e 100644 --- a/rewrite-maven/src/test/java/org/openrewrite/maven/MavenParserTest.java +++ b/rewrite-maven/src/test/java/org/openrewrite/maven/MavenParserTest.java @@ -853,7 +853,6 @@ void mirrorsAndAuth() throws IOException { var password = "password"; try (MockWebServer mockRepo = new MockWebServer()) { mockRepo.setDispatcher(new Dispatcher() { - @SuppressWarnings("NullableProblems") @Override public MockResponse dispatch(RecordedRequest request) { MockResponse resp = new MockResponse();