Skip to content

Add a recipe to migrate from JBoss Logging to SLF4J #241

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pdelagrave
Copy link
Contributor

@pdelagrave pdelagrave commented Jul 21, 2025

What's changed?

What's your motivation?

Anything in particular you'd like reviewers to focus on?

Anyone you would like to review specifically?

Have you considered any alternatives or workarounds?

Any additional context

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Jul 21, 2025
*/
package org.openrewrite.java.logging.slf4j;

import org.junit.jupiter.api.Test;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Test;
import org.openrewrite.DocumentExample;

import static org.openrewrite.java.Assertions.mavenProject;
import static org.openrewrite.maven.Assertions.pomXml;

public class JBossLoggingToSlf4jTest implements RewriteTest {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public class JBossLoggingToSlf4jTest implements RewriteTest {
class JBossLoggingToSlf4jTest implements RewriteTest {

);
}

@Test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@Test
@DocumentExample
@Test
void gradle() {
rewriteRun(recipeSpec -> recipeSpec.beforeRecipe(withToolingApi()),
//language=gradle
buildGradle(
"""
plugins { id "java" }
repositories { mavenCentral() }
dependencies {
implementation("org.jboss.logmanager:jboss-logmanager:latest.release")
implementation("org.jboss.logging:jboss-logging:latest.release")
}
""",
"""
plugins { id "java" }
repositories { mavenCentral() }
dependencies {
implementation("org.jboss.logmanager:jboss-logmanager:latest.release")
implementation("org.jboss.slf4j:slf4j-jboss-logmanager:latest.release")
}
"""
)
);
}
@Test

Comment on lines +86 to +111
}

@Test
void gradle() {
rewriteRun(recipeSpec -> recipeSpec.beforeRecipe(withToolingApi()),
//language=gradle
buildGradle(
"""
plugins { id "java" }
repositories { mavenCentral() }
dependencies {
implementation("org.jboss.logmanager:jboss-logmanager:latest.release")
implementation("org.jboss.logging:jboss-logging:latest.release")
}
""",
"""
plugins { id "java" }
repositories { mavenCentral() }
dependencies {
implementation("org.jboss.logmanager:jboss-logmanager:latest.release")
implementation("org.jboss.slf4j:slf4j-jboss-logmanager:latest.release")
}
"""
)
);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
@Test
void gradle() {
rewriteRun(recipeSpec -> recipeSpec.beforeRecipe(withToolingApi()),
//language=gradle
buildGradle(
"""
plugins { id "java" }
repositories { mavenCentral() }
dependencies {
implementation("org.jboss.logmanager:jboss-logmanager:latest.release")
implementation("org.jboss.logging:jboss-logging:latest.release")
}
""",
"""
plugins { id "java" }
repositories { mavenCentral() }
dependencies {
implementation("org.jboss.logmanager:jboss-logmanager:latest.release")
implementation("org.jboss.slf4j:slf4j-jboss-logmanager:latest.release")
}
"""
)
);
}
}

@timtebeek timtebeek added the enhancement New feature or request label Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Recipe to migrate from JBoss Logging to SLF4J
2 participants