Skip to content

Commit 194ecce

Browse files
Merge pull request #1028 from anthonydahanne/fix-1027-mysql-name
Fix #1027: properly detect new mysql connector
2 parents 6a6706f + b175126 commit 194ecce

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

docs/framework-maria_db_jdbc.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ The MariaDB JDBC Framework causes a JDBC driver JAR to be automatically download
44
<table>
55
<tr>
66
<td><strong>Detection Criterion</strong></td>
7-
<td>Existence of a single bound MariaDB or MySQL service and no provided MariaDB or MySQL JDBC JAR.
7+
<td>Existence of a single bound MariaDB or MySQL service and NO provided MariaDB or MySQL JDBC jar.
88
<ul>
9-
<li>Existence of a MariaDB service is defined as the <a href="http://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES"><code>VCAP_SERVICES</code></a> payload containing a service who's name, label or tag has <code>mariadb</code> as a substring.</li>
10-
<li>Existence of a MySQL service is defined as the <a href="http://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES"><code>VCAP_SERVICES</code></a> payload containing a service who's name, label or tag has <code>mysql</code> as a substring.</li>
11-
<li>Existence of a MariaDB JDBC JAR is defined as the application containing a JAR who's name matches <tt>mariadb-java-client*.jar</tt></li>
12-
<li>Existence of a MySQL JDBC JAR is defined as the application containing a JAR who's name matches <tt>mysql-connector-java*.jar</tt></li>
9+
<li>Existence of a MariaDB service is defined as the <a href="http://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES"><code>VCAP_SERVICES</code></a> payload containing a service whose name, label or tag has <code>mariadb</code> as a substring.</li>
10+
<li>Existence of a MySQL service is defined as the <a href="http://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES"><code>VCAP_SERVICES</code></a> payload containing a service whose name, label or tag has <code>mysql</code> as a substring.</li>
11+
<li>Existence of a MariaDB JDBC jar is defined as the application containing a JAR whose name matches <code>mariadb-java-client*.jar</code></li>
12+
<li>Existence of a MySQL JDBC jar is defined as the application containing a JAR whose name matches <code>mysql-connector-j*.jar</code></li>
1313
</ul>
1414
</td>
1515
</tr>
1616
<tr>
1717
<td><strong>Tags</strong></td>
18-
<td><tt>maria-db-jdbc=&lt;version&gt;</tt></td>
18+
<td><code>maria-db-jdbc=&lt;version&gt;</code></td>
1919
</tr>
2020
</table>
2121
Tags are printed to standard output by the buildpack detect script

lib/java_buildpack/framework/maria_db_jdbc.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def supports?
4646
private
4747

4848
def driver?
49-
%w[mariadb-java-client*.jar mysql-connector-java*.jar].any? do |candidate|
49+
%w[mariadb-java-client*.jar mysql-connector-j*.jar].any? do |candidate|
5050
(@application.root + '**' + candidate).glob.any?
5151
end
5252
end

spec/fixtures/framework_mariadb_jdbc_with_new_mysql_driver/WEB-INF/lib/mysql-connector-j-8.0.33.jar

Whitespace-only changes.

spec/java_buildpack/framework/maria_db_jdbc_spec.rb

+6
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@
4949
expect(component.detect).to be_nil
5050
end
5151

52+
it 'does not detect if the application has a new style -j MySQL driver',
53+
app_fixture: 'framework_mariadb_jdbc_with_new_mysql_driver' do
54+
55+
expect(component.detect).to be_nil
56+
end
57+
5258
it 'downloads the MariaDB driver when needed',
5359
cache_fixture: 'stub-mariadb-java-client.jar' do
5460

0 commit comments

Comments
 (0)