codacy-tomcatcp-dropwizard

TomcatCP Plugin

License

License

Categories

Categories

Tomcat Container Application Servers DropWizard Microservices
GroupId

GroupId

com.codacy
ArtifactId

ArtifactId

codacy-tomcatcp-dropwizard_2.11
Last Version

Last Version

5.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

codacy-tomcatcp-dropwizard
TomcatCP Plugin
Project Organization

Project Organization

Codacy
Source Code Management

Source Code Management

https://github.com/codacy/play-tomcatcp

Download codacy-tomcatcp-dropwizard_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/com.codacy/codacy-tomcatcp-dropwizard_2.11/ -->
<dependency>
    <groupId>com.codacy</groupId>
    <artifactId>codacy-tomcatcp-dropwizard_2.11</artifactId>
    <version>5.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/com.codacy/codacy-tomcatcp-dropwizard_2.11/
implementation 'com.codacy:codacy-tomcatcp-dropwizard_2.11:5.0.4'
// https://jarcasting.com/artifacts/com.codacy/codacy-tomcatcp-dropwizard_2.11/
implementation ("com.codacy:codacy-tomcatcp-dropwizard_2.11:5.0.4")
'com.codacy:codacy-tomcatcp-dropwizard_2.11:jar:5.0.4'
<dependency org="com.codacy" name="codacy-tomcatcp-dropwizard_2.11" rev="5.0.4">
  <artifact name="codacy-tomcatcp-dropwizard_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.codacy', module='codacy-tomcatcp-dropwizard_2.11', version='5.0.4')
)
libraryDependencies += "com.codacy" % "codacy-tomcatcp-dropwizard_2.11" % "5.0.4"
[com.codacy/codacy-tomcatcp-dropwizard_2.11 "5.0.4"]

Dependencies

compile (4)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.11
com.codacy : codacy-tomcatcp_2.11 jar 5.0.4
io.dropwizard.metrics : metrics-core jar 3.2.5
io.dropwizard.metrics : metrics-healthchecks jar 3.2.5

Project Modules

There are no modules declared in this project.

Tomcat JDBC Connection Pool Plugin

Codacy Badge Codacy Badge Circle CI Maven Central

This is a generic plugin supporting version 8.8.19 of Tomcat JDBC CP.

Frameworks:

  • PlayFramework 2.4.3
  • PlayFramework 2.4.x
  • PlayFramework 2.5.x
  • PlayFramework 2.6.x

Metrics:

  • Dropwizard 3.2.x
  • Dropwizard 4.0.x

Usage

Base

Add the dependency to your build.sbt:

  • "com.codacy" %% "codacy-tomcatcp" % "<latest-version>"

PlayFramework

  1. Add the dependency to your build.sbt:
  • "com.codacy" %% "codacy-tomcatcp-play243" % "<latest-version>"

OR

  • "com.codacy" %% "codacy-tomcatcp-play24" % "<latest-version>"

OR

  • "com.codacy" %% "codacy-tomcatcp-play25" % "<latest-version>"

OR

  • "com.codacy" %% "codacy-tomcatcp-play26" % "<latest-version>"
  1. Now add the following lines to your conf/application.conf:
play.modules.disabled += "play.api.db.HikariCPModule"
play.modules.enabled += "com.codacy.tomcatcp.play.TomcatCPModule"

This will disable Hikari and enable the Tomcat plugin.

Metrics

  • "com.codacy" %% "codacy-tomcatcp-dropwizard3" % "<latest-version>"

OR

  • "com.codacy" %% "codacy-tomcatcp-dropwizard4" % "<latest-version>"

Custom Options

If you have any problems with the connection validation query, defining a custom validator might help.

For example if you define a validatorClassName as described bellow it will be used instead of the default.

We have com.codacy.tomcatcp.validators.TomcatValidator that uses a timeout to avoid blocking for long times while validating the connection.

Example Configuration:

driver = org.example.Driver
url = "jdbc:postgresql://localhost:5432/exampledb"
username = "example"
password = "example"

tomcatcp {
  testOnBorrow = true
  validationInterval = 5000
  testWhileIdle = false
  validatorClassName = "com.codacy.tomcatcp.validators.TomcatValidator"

  initialSize = 2
  minIdle = 2
  maxActive = 5
  maxIdle = 5
}

Additional configuration

For detailed descriptions on each option check the Tomcat JDBC CP Configuration page.

Thanks

The code here is highly inspired by the HikariCP plugin.

What is Codacy?

Codacy is an Automated Code Review Tool that monitors your technical debt, helps you improve your code quality, teaches best practices to your developers, and helps you save time in Code Reviews.

Among Codacy’s features:

  • Identify new Static Analysis issues
  • Commit and Pull Request Analysis with GitHub, BitBucket/Stash, GitLab (and also direct git repositories)
  • Auto-comments on Commits and Pull Requests
  • Integrations with Slack, HipChat, Jira, YouTrack
  • Track issues in Code Style, Security, Error Proneness, Performance, Unused Code and other categories

Codacy also helps keep track of Code Coverage, Code Duplication, and Code Complexity.

Codacy supports PHP, Python, Ruby, Java, JavaScript, and Scala, among others.

Free for Open Source

Codacy is free for Open Source projects.

com.codacy

Codacy

Versions

Version
5.0.4
5.0.3
5.0.2
5.0.1
5.0.0