From 37078fb9e3ff12250ea2d80a0bc07b31da7f6862 Mon Sep 17 00:00:00 2001 From: Gunnar Morling Date: Fri, 27 Apr 2012 17:23:19 +0200 Subject: [PATCH 1/3] HV-578: Removing slf4j dependencies, adding log4j as dependency where required for testing --- archetype/pom.xml | 4 ++-- distribution/pom.xml | 4 ++-- distribution/src/main/assembly/dist.xml | 2 -- engine/pom.xml | 4 ++-- integration/pom.xml | 4 ++-- .../integration/util/IntegrationTestUtil.java | 2 +- performance/pom.xml | 22 ++++++++++--------- pom.xml | 17 +++----------- tck-runner/pom.xml | 18 ++++----------- 9 files changed, 28 insertions(+), 49 deletions(-) diff --git a/archetype/pom.xml b/archetype/pom.xml index 6a8ad84e3a..e06eb86a75 100644 --- a/archetype/pom.xml +++ b/archetype/pom.xml @@ -47,8 +47,8 @@ ${project.parent.version} - org.slf4j - slf4j-log4j12 + log4j + log4j runtime diff --git a/distribution/pom.xml b/distribution/pom.xml index f28b4352d0..3c19d72f0c 100644 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -48,8 +48,8 @@ - org.slf4j - slf4j-log4j12 + log4j + log4j org.hibernate.javax.persistence diff --git a/distribution/src/main/assembly/dist.xml b/distribution/src/main/assembly/dist.xml index d4a9abec23..b04b2dc5f8 100644 --- a/distribution/src/main/assembly/dist.xml +++ b/distribution/src/main/assembly/dist.xml @@ -50,8 +50,6 @@ dist/lib/optional - org.slf4j:slf4j-api - org.slf4j:slf4j-log4j12 log4j:log4j joda-time:joda-time org.hibernate.javax.persistence:hibernate-jpa-2.0-api diff --git a/engine/pom.xml b/engine/pom.xml index c81b35ac43..54876311fc 100644 --- a/engine/pom.xml +++ b/engine/pom.xml @@ -78,8 +78,8 @@ test - org.slf4j - slf4j-log4j12 + log4j + log4j test diff --git a/integration/pom.xml b/integration/pom.xml index 72810d1746..153a1130a7 100644 --- a/integration/pom.xml +++ b/integration/pom.xml @@ -76,8 +76,8 @@ test - org.slf4j - slf4j-log4j12 + log4j + log4j test diff --git a/integration/src/test/java/org/hibernate/validator/integration/util/IntegrationTestUtil.java b/integration/src/test/java/org/hibernate/validator/integration/util/IntegrationTestUtil.java index c6fda91fc8..ece71d50f6 100644 --- a/integration/src/test/java/org/hibernate/validator/integration/util/IntegrationTestUtil.java +++ b/integration/src/test/java/org/hibernate/validator/integration/util/IntegrationTestUtil.java @@ -87,7 +87,7 @@ public static Collection bundleHibernateValidatorWithDependencies(b public static Collection bundleLoggingDependencies() { return DependencyResolvers.use( MavenDependencyResolver.class ) .loadMetadataFromPom( "pom.xml" ) - .artifact( "org.slf4j:slf4j-log4j12" ) + .artifact( "log4j:log4j" ) .resolveAs( JavaArchive.class ); } } diff --git a/performance/pom.xml b/performance/pom.xml index ad2c736368..1f9bddbc81 100644 --- a/performance/pom.xml +++ b/performance/pom.xml @@ -40,14 +40,6 @@ javax.validation validation-api - - org.slf4j - slf4j-api - - - org.slf4j - slf4j-log4j12 - junit junit @@ -115,8 +107,8 @@ hibernate-validator - org.jboss.logging - jboss-logging + log4j + log4j @@ -137,6 +129,11 @@ hibernate-validator 4.2.0.Final + + org.slf4j + slf4j-log4j12 + 1.6.1 + HV 4.2.0.Final @@ -156,6 +153,11 @@ hibernate-validator 4.1.0.Final + + org.slf4j + slf4j-log4j12 + 1.5.6 + HV 4.1.0.Final diff --git a/pom.xml b/pom.xml index 499e3ee313..4ae648e55e 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,6 @@ UTF-8 - 1.6.1 1.0-beta-3 @@ -111,19 +110,9 @@ 1.6 - org.slf4j - slf4j-api - ${slf4j.version} - - - org.slf4j - slf4j-log4j12 - ${slf4j.version} - - - org.slf4j - slf4j-simple - ${slf4j.version} + log4j + log4j + 1.2.16 org.hibernate.javax.persistence diff --git a/tck-runner/pom.xml b/tck-runner/pom.xml index 896f7ac282..5841ba43d5 100644 --- a/tck-runner/pom.xml +++ b/tck-runner/pom.xml @@ -47,16 +47,6 @@ org.hibernate hibernate-validator - - org.slf4j - slf4j-api - test - - - org.slf4j - slf4j-simple - test - org.hibernate.javax.persistence hibernate-jpa-2.0-api @@ -313,14 +303,14 @@ ${project.build.directory}/dependency/lib - org.slf4j - slf4j-simple + org.jboss.logging + jboss-logging true ${project.build.directory}/dependency/lib - org.slf4j - slf4j-api + log4j + log4j true ${project.build.directory}/dependency/lib From a5da101ff4dd4fe64140d1bce5f0c3a8c7307534 Mon Sep 17 00:00:00 2001 From: Gunnar Morling Date: Fri, 27 Apr 2012 18:17:19 +0200 Subject: [PATCH 2/3] HV-578: Updating readme file to mention JBoss Logging instead of slf4j --- README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 92149703bf..c03f638386 100644 --- a/README.md +++ b/README.md @@ -30,13 +30,10 @@ JDK 1.6 or above. ## Using Hibernate Validator * In case you use the distribution archive from the download site, copy dist/hibernate-validator-.jar together with all -jar files from dist/lib/required into the classpath of your application. You can switch the slf4j binding jars for log4j -(log4j-.jar and slf4j-log4j12-.jar) with the slf4j binding files of your choice. See http://www.slf4j.org/manual.html - In case you are using Java 5 you have to also include all the jar files from the dist/lib/jdk5 directory. - The jar files contain the classes needed for JAXB. If you don't use the xml configuration and XML configuration - is disabled via Configuration.ignoreXmlConfiguration the jar files from the dist/lib/jdk5 directory don't have to be added. - -or +jar files from dist/lib/required into the classpath of your application. For the purposes of logging, Hibernate Validator uses +the JBoss Logging API, an abstraction layer which supports several logging solutions such (e.g. log4j or the logging framework +provided by the JDK) as implementation. Just add a supported logging library to the classpath (e.g. log4j-.jar) and JBoss +Logging will delegate any log requests to that provider. * Add the following to your maven or ivy dependency list (Hibernate Validator can be found in the [JBoss Maven repository](http://repository.jboss.org/nexus/content/groups/public-jboss)): From cf00e843632df1176814dbfbb1314dc09d41f418 Mon Sep 17 00:00:00 2001 From: Gunnar Morling Date: Sun, 29 Apr 2012 19:52:11 +0200 Subject: [PATCH 3/3] HV-578: Adding note on JBoss Logging to reference guide, updating "Getting started" chapter a bit --- .../docbook/en-US/modules/gettingstarted.xml | 49 +++++++++++++------ 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/documentation/src/main/docbook/en-US/modules/gettingstarted.xml b/documentation/src/main/docbook/en-US/modules/gettingstarted.xml index e71fb637c4..72ac1da815 100644 --- a/documentation/src/main/docbook/en-US/modules/gettingstarted.xml +++ b/documentation/src/main/docbook/en-US/modules/gettingstarted.xml @@ -66,10 +66,22 @@
- Setting up a new Maven project + Project set up + + In order to use Hibernate Validator within an existing Maven + project, simply add the following dependency to your + pom.xml: + Maven dependency of Hibernate Validator + + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-validator</artifactId> + <version>&version;</version> +</dependency> + - Start by creating new Maven project using the Maven archetype plugin - as follows: + Alternatively, you can start by creating a sample project using + Hibernate Validator's Quickstart Maven archetype as follows: Using Maven's archetype plugin to create a sample project using @@ -88,16 +100,21 @@ <para><programlisting>mvn test</programlisting> Maven will compile the example code and run the implemented unit tests. Let's have a look at the - actual code.</para> - - <note> - <para>From version 4.2.0.Beta2, the maven command <command>mvn - archetype:create</command> will be no longer supported and will fail. - You should use the command described in the above listing. If you want - more details, look at <ulink - url="http://maven.apache.org/archetype/maven-archetype-plugin/"> Maven - Archetype plugin</ulink> page.</para> - </note> + actual code in the next section.</para> + + <tip> + <para>For the purposes of logging, Hibernate Validator uses the JBoss + Logging API. This is an abstraction layer which supports several known + logging solutions (e.g. log4j or the logging framework provided by the + JDK) as implementation. Just add your preferred logging library to the + classpath and all log requests from Hibernate Validator will + automatically be delegated to that logging provider.</para> + + <para>Alternatively, you can explicitely specify a provider using the + system property <varname>org.jboss.logging.provider</varname>. Supported + values currently are <varname>jboss</varname>, <varname>jdk</varname>, + <varname>log4j</varname> and <varname>slf4j</varname>.</para> + </tip> </section> <section id="validator-gettingstarted-createmodel"> @@ -282,10 +299,10 @@ public class CarTest { <para>That concludes our 5 minute tour through the world of Hibernate Validator. Continue exploring the code examples or look at further - examples referenced in <xref linkend="validator-further-reading" />. To + examples referenced in <xref linkend="validator-further-reading"/>. To deepen your understanding of Hibernate Validator just continue reading - <xref linkend="validator-usingvalidator" />. In case your application has + <xref linkend="validator-usingvalidator"/>. In case your application has specific validation requirements have a look at <xref - linkend="validator-customconstraints" />.</para> + linkend="validator-customconstraints"/>.</para> </section> </chapter>