String (MavenProject mavenProject, boolean isTest, String relativeTo) { var annotationProcessorDirectory = mavenProject.getAnnotationProcessorDirectory(isTest); Path path = Path.of(annotationProcessorDirectory); if (!path.isAbsolute()) { return annotationProcessorDirectory; } try { return Path.of(relativeTo).relativize(path).toString(); } catch (IllegalArgumentException e) { return isTest ? DEFAULT_TEST_ANNOTATION_OUTPUT : DEFAULT_ANNOTATION_PATH_OUTPUT; } }