咨询JBoss 5.1.0 GA提供的log4j对应的Maven依赖坐标
JBoss AS 5.1.0 GA Provided Log4j Dependency Configuration
Great question! When migrating your legacy project to Maven and dealing with the org.apache.log4j.Logger class provided by JBoss AS 5.1.0 GA, here's the correct provided dependency you need to add to your pom.xml:
<dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.14</version> <scope>provided</scope> </dependency>
Key Details:
- Why these values?: JBoss AS 5.1.0 GA ships with Log4j version 1.2.14 out of the box. This is the standard Log4j artifact (not a JBoss-specific variant), so the groupId and artifactId match the official Log4j Maven coordinates.
providedscope: This tells Maven that the dependency will be supplied by the runtime environment (your JBoss server) and shouldn't be included in your application's packaged artifact (like a WAR or EAR). This prevents version conflicts between your project's dependencies and the ones bundled with JBoss.
You can verify this by checking the server/default/lib directory in your JBoss AS 5.1.0 GA installation—you'll find the log4j-1.2.14.jar file there, confirming the exact version and artifact details.
内容的提问来源于stack exchange,提问作者carpinchosaurio




