diff --git a/src/main/java/org/openrewrite/maven/MavenMojoProjectParser.java b/src/main/java/org/openrewrite/maven/MavenMojoProjectParser.java
index 7c17e80c..6f733daf 100644
--- a/src/main/java/org/openrewrite/maven/MavenMojoProjectParser.java
+++ b/src/main/java/org/openrewrite/maven/MavenMojoProjectParser.java
@@ -191,7 +191,7 @@ private MavenSettings buildSettings() {
p.getActivation() == null ? null : new ProfileActivation(
p.getActivation().isActiveByDefault(),
p.getActivation().getJdk(),
- new ProfileActivation.Property(
+ p.getActivation().getProperty() == null ? null : new ProfileActivation.Property(
p.getActivation().getProperty().getName(),
p.getActivation().getProperty().getValue()
)
diff --git a/src/test/java/org/openrewrite/maven/BasicIT.java b/src/test/java/org/openrewrite/maven/BasicIT.java
index c21344b8..7c083eb0 100644
--- a/src/test/java/org/openrewrite/maven/BasicIT.java
+++ b/src/test/java/org/openrewrite/maven/BasicIT.java
@@ -19,6 +19,23 @@ void groupid_artifactid_should_be_ok(MavenExecutionResult result) {
.containsOnly("JAR will be empty - no content was marked for inclusion!");
}
+ @MavenTest
+ @MavenOption(value = MavenCLIOptions.SETTINGS, parameter = "settings.xml")
+ @MavenGoal("${project.groupId}:${project.artifactId}:${project.version}:dryRun")
+ void null_check_profile_activation(MavenExecutionResult result) {
+ assertThat(result)
+ .isSuccessful()
+ .out()
+ .info()
+ .anySatisfy(line -> assertThat(line).contains("Applying recipes would make no changes. No patch file generated."));
+
+ assertThat(result)
+ .isSuccessful()
+ .out()
+ .warn()
+ .isEmpty();
+ }
+
@MavenTest
@SystemProperty(value = "ossrh_snapshots_url", content = "https://oss.sonatype.org/content/repositories/snapshots")
@MavenGoal("${project.groupId}:${project.artifactId}:${project.version}:dryRun")
diff --git a/src/test/resources-its/org/openrewrite/maven/BasicIT/null_check_profile_activation/pom.xml b/src/test/resources-its/org/openrewrite/maven/BasicIT/null_check_profile_activation/pom.xml
new file mode 100644
index 00000000..8ed3076e
--- /dev/null
+++ b/src/test/resources-its/org/openrewrite/maven/BasicIT/null_check_profile_activation/pom.xml
@@ -0,0 +1,32 @@
+
+ 4.0.0
+
+ org.openrewrite.maven
+ null_check_profile_activation
+ 1.0
+ jar
+ BasicIT#null_check_profile_activation
+
+
+ 1.8
+ 1.8
+ UTF-8
+
+
+
+
+
+ @project.groupId@
+ @project.artifactId@
+ @project.version@
+
+
+ org.openrewrite.java.format.AutoFormat
+
+
+
+
+
+
diff --git a/src/test/resources-its/org/openrewrite/maven/BasicIT/null_check_profile_activation/settings.xml b/src/test/resources-its/org/openrewrite/maven/BasicIT/null_check_profile_activation/settings.xml
new file mode 100644
index 00000000..7189857e
--- /dev/null
+++ b/src/test/resources-its/org/openrewrite/maven/BasicIT/null_check_profile_activation/settings.xml
@@ -0,0 +1,19 @@
+
+
+
+ example_profile_id
+
+ true
+
+
+
+ example_repository_id
+ https://repo1.maven.org/maven2
+
+
+
+
+
+
\ No newline at end of file