diff --git a/docs/framework-maria_db_jdbc.md b/docs/framework-maria_db_jdbc.md index 5e146253a8..635767f92f 100644 --- a/docs/framework-maria_db_jdbc.md +++ b/docs/framework-maria_db_jdbc.md @@ -4,18 +4,18 @@ The MariaDB JDBC Framework causes a JDBC driver JAR to be automatically download - - +
Detection CriterionExistence of a single bound MariaDB or MySQL service and no provided MariaDB or MySQL JDBC JAR. + Existence of a single bound MariaDB or MySQL service and NO provided MariaDB or MySQL JDBC jar.
    -
  • Existence of a MariaDB service is defined as the VCAP_SERVICES payload containing a service who's name, label or tag has mariadb as a substring.
  • -
  • Existence of a MySQL service is defined as the VCAP_SERVICES payload containing a service who's name, label or tag has mysql as a substring.
  • -
  • Existence of a MariaDB JDBC JAR is defined as the application containing a JAR who's name matches mariadb-java-client*.jar
  • -
  • Existence of a MySQL JDBC JAR is defined as the application containing a JAR who's name matches mysql-connector-java*.jar
  • +
  • Existence of a MariaDB service is defined as the VCAP_SERVICES payload containing a service whose name, label or tag has mariadb as a substring.
  • +
  • Existence of a MySQL service is defined as the VCAP_SERVICES payload containing a service whose name, label or tag has mysql as a substring.
  • +
  • Existence of a MariaDB JDBC jar is defined as the application containing a JAR whose name matches mariadb-java-client*.jar
  • +
  • Existence of a MySQL JDBC jar is defined as the application containing a JAR whose name matches mysql-connector-j*.jar
Tagsmaria-db-jdbc=<version>maria-db-jdbc=<version>
Tags are printed to standard output by the buildpack detect script diff --git a/lib/java_buildpack/framework/maria_db_jdbc.rb b/lib/java_buildpack/framework/maria_db_jdbc.rb index 628010d1e7..712b367804 100644 --- a/lib/java_buildpack/framework/maria_db_jdbc.rb +++ b/lib/java_buildpack/framework/maria_db_jdbc.rb @@ -46,7 +46,7 @@ def supports? private def driver? - %w[mariadb-java-client*.jar mysql-connector-java*.jar].any? do |candidate| + %w[mariadb-java-client*.jar mysql-connector-j*.jar].any? do |candidate| (@application.root + '**' + candidate).glob.any? end end diff --git a/spec/fixtures/framework_mariadb_jdbc_with_new_mysql_driver/WEB-INF/lib/mysql-connector-j-8.0.33.jar b/spec/fixtures/framework_mariadb_jdbc_with_new_mysql_driver/WEB-INF/lib/mysql-connector-j-8.0.33.jar new file mode 100644 index 0000000000..e69de29bb2 diff --git a/spec/java_buildpack/framework/maria_db_jdbc_spec.rb b/spec/java_buildpack/framework/maria_db_jdbc_spec.rb index a3ce5aad26..0ecdc315da 100644 --- a/spec/java_buildpack/framework/maria_db_jdbc_spec.rb +++ b/spec/java_buildpack/framework/maria_db_jdbc_spec.rb @@ -49,6 +49,12 @@ expect(component.detect).to be_nil end + it 'does not detect if the application has a new style -j MySQL driver', + app_fixture: 'framework_mariadb_jdbc_with_new_mysql_driver' do + + expect(component.detect).to be_nil + end + it 'downloads the MariaDB driver when needed', cache_fixture: 'stub-mariadb-java-client.jar' do