Skip to content

Commit e3cda3a

Browse files
committed
Issue 14379 Remove dependency to tomcat-embed-logging-log4j
The dependency 'tomcat-embed-logging-log4j' is old, unmaintained and should not be used. Updated Hibernate documentation and example #14379
1 parent 712a1c0 commit e3cda3a

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

grails-data-hibernate5/docs/src/docs/asciidoc/gettingStarted/outsideGrails.adoc

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ specific language governing permissions and limitations
1717
under the License.
1818
////
1919

20-
If you wish to use GORM for Hibernate outside of a Grails application you should declare the necessary dependencies for GORM and the database you are using, for example in Gradle:
20+
If you wish to use GORM for Hibernate outside a Grails application you should declare the necessary dependencies for GORM and the database you are using, for example in Gradle:
2121

2222
[source,groovy,subs="attributes"]
2323
----
24-
compile "org.apache.grails.data:grails-data-hibernate5-core:{version}"
25-
runtime "com.h2database:h2:1.4.192"
26-
runtime "org.apache.tomcat:tomcat-jdbc:8.5.0"
27-
runtime "org.apache.tomcat.embed:tomcat-embed-logging-log4j:8.5.0"
28-
runtime "org.slf4j:slf4j-api:1.7.10"
24+
implementation platform("org.apache.grails:{version}")
25+
implementation "org.apache.grails.data:grails-data-hibernate5-core"
26+
runtimeOnly "com.h2database"
27+
runtimeOnly "org.apache.tomcat:tomcat-jdbc"
28+
runtimeOnly "org.slf4j:slf4j-nop"
2929
----
3030

3131
NOTE: The above example also uses the https://www.h2database.com[H2 Database] and Tomcat connection pool.
32-
However other pool implementations are supported including `commons-dbcp`, `tomcat pool` or `hikari`.
32+
However, other pool implementations are supported including `commons-dbcp`, `tomcat pool` or `hikari`.
3333
If a connection pool is not specified `org.springframework.jdbc.datasource.DriverManagerDataSource` is used,
34-
which creates a new connection to the database each time you request a connect.
34+
which creates a new connection to the database each time you request a connection.
3535
The latter will probably cause issues with an H2 in-memory database in that it will create a new in-memory
3636
database each time a connection is requested, losing previously created tables.
3737
Normal databases (`MySql`, `Postgres` or even file-based `H2`) are not affected.
@@ -40,6 +40,9 @@ Then create your entities in the `src/main/groovy` directory and annotate them w
4040

4141
[source,groovy]
4242
----
43+
import grails.gorm.annotation.Entity
44+
import org.grails.datastore.gorm.GormEntity
45+
4346
@Entity
4447
class Person implements GormEntity<Person> { // <1>
4548
String firstName

0 commit comments

Comments
 (0)