identitii / gdbc

JDBC driver wrapper for golang
MIT License
101 stars 12 forks source link

Compiling with Filemaker fmodbc.jar #4

Closed csmu-cenr closed 3 years ago

csmu-cenr commented 3 years ago

I've got a test java file connecting to FileMaker and executing SQL queries. I've tried using an explicit system scope with an explicit path to the jar file to build with but mavin is looking for an external reference that does not exist.

How do you reference a local dependency to build with mavin?

The pom.xml file specifies to use a local jar but for some as yet unknown reason to me it's trying to get a network copy that does not exist.

This is the pom.xml extract.

        <dependency>
            <groupId>com.filemaker</groupId>
            <artifactId>jdbc</artifactId>
            <version>19.0.0</version>
            <scope>system</scope>
            <systemPath>${basedir}/src/main/java/filemaker/jdbc/driver/fmjdbc.jar</systemPath>
        </dependency>

This is the tvf output of the class.

 11150 Wed Mar 25 22:01:38 CST 2020 META-INF/MANIFEST.MF
 11276 Wed Mar 25 22:01:40 CST 2020 META-INF/1.SF
  9358 Wed Mar 25 22:01:40 CST 2020 META-INF/1.RSA
     0 Wed Mar 25 22:11:38 CST 2020 META-INF/
     0 Sun Mar 03 04:47:28 CST 2019 META-INF/services/
    26 Fri Jan 27 21:22:50 CST 2017 META-INF/services/java.sql.Driver
     0 Wed Mar 25 22:11:36 CST 2020 com/
     0 Wed Mar 25 22:11:36 CST 2020 com/filemaker/
     0 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/
   954 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/BaseConnection.class
  1122 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/BaseResultSet.class
   858 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/BaseStatement.class
  5283 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/Driver.class
  4384 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/Encoding.class
   567 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMAutoCommitRequest.class
   769 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMCloseCursorRequest.class
   704 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMColumnCountResponse.class
  1852 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMColumnDescriptionResponse.class
   791 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMColumnPrivilegesRequest.class
   481 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMColumnValue$State.class
  1687 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMColumnValue.class
   772 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMColumnsRequest.class
  1035 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMConnectionResponse.class
   773 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMDatabaseListRequest.class
  1410 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMDatabaseListResponse.class
   296 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMDisconnectRequest.class
   588 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMEndStatementRequest.class
   828 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMErrorResponse.class
   587 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMEstablishSSLRequest.class
  2330 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMExecuteRequest.class
   637 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMIndexRequest.class
  1653 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMLoginRequest.class
   653 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMLoginResponse.class
  1309 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMNextRowsRequest.class
   629 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMPrepareRequest.class
   648 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMPrimaryKeyRequest.class
  1787 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMQueryRequest.class
  2151 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMRowResponse.class
  1210 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMSQLException.class
  2327 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMStream$1.class
 13278 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMStream.class
  1073 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMSuccessResponse.class
   639 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMTablesRequest.class
   574 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FMTransactionRequest.class
 14836 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/FM_API.class
  1314 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/Field.class
  4800 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/MessageBlock.class
   368 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/MessageBlockBytes.class
   348 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/MessageListItem.class
  3990 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc/ProtocolMessage.class
     0 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc1/
 13187 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc1/CommonJ1Connection.class
 25582 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc1/CommonJ1DatabaseMetaData.class
 18536 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc1/CommonJ1ResultSet.class
  4496 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc1/CommonJ1ResultSetMetaData.class
 36617 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc1/CommonJ1Statement.class
  1701 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc1/FMInputStream.class
     0 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/
  7359 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/Array.class
   958 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/CommonJ2Blob.class
  1130 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/CommonJ2Clob.class
  2734 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/CommonJ2Connection.class
  1686 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/CommonJ2DatabaseMetaData.class
   369 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/CommonJ2ResultSet$NullObject.class
   642 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/CommonJ2ResultSet$PrimaryKey.class
 21060 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/CommonJ2ResultSet.class
  4171 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/CommonJ2ResultSetMetaData.class
  6540 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/CommonJ2Statement.class
     0 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/optional/
  4098 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/optional/BaseDataSource.class
  1780 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/optional/ConnectionPool.class
  2345 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/optional/FMObjectFactory.class
  4012 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/optional/PooledConnectionImpl$ConnectionHandler.class
  2506 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/optional/PooledConnectionImpl$StatementHandler.class
  3426 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/optional/PooledConnectionImpl.class
  1424 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/optional/PoolingDataSource$1.class
  6211 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/optional/PoolingDataSource.class
  1292 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc2/optional/SimpleDataSource.class
     0 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/
   734 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/CommonJ3Blob.class
   847 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/CommonJ3Clob.class
  3411 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/CommonJ3Connection.class
  5732 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/CommonJ3DatabaseMetaData.class
  1225 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/CommonJ3ParameterMetaData.class
  4710 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/CommonJ3ResultSet.class
 10906 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/CommonJ3Statement.class
   269 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/J3Blob.class
  1416 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/J3CallableStatement.class
   269 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/J3Clob.class
  1605 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/J3Connection.class
  1323 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/J3ConnectionPool.class
   562 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/J3DatabaseMetaData.class
  1749 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/J3ObjectFactory.class
   210 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/J3PooledConnection.class
  2173 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/J3PoolingDataSource.class
  1078 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/J3PreparedStatement.class
  1117 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/J3RefCursorResultSet.class
  1580 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/J3ResultSet.class
   264 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/J3ResultSetMetaData.class
   825 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/J3SimpleDataSource.class
  1015 Wed Mar 25 22:11:36 CST 2020 com/filemaker/jdbc3/J3Statement.class
     0 Wed Mar 25 22:11:36 CST 2020 com/filemaker/largeobject/
  1290 Wed Mar 25 22:11:36 CST 2020 com/filemaker/largeobject/BlobInputStream.class
  1196 Wed Mar 25 22:11:36 CST 2020 com/filemaker/largeobject/BlobOutputStream.class
  1828 Wed Mar 25 22:11:36 CST 2020 com/filemaker/largeobject/LargeObject.class
  1383 Wed Mar 25 22:11:36 CST 2020 com/filemaker/largeobject/LargeObjectManager.class
     0 Wed Mar 25 22:11:36 CST 2020 com/filemaker/util/
 11461 Wed Mar 25 22:11:36 CST 2020 com/filemaker/util/AES.class
   995 Wed Mar 25 22:11:36 CST 2020 com/filemaker/util/FMblob.class
   814 Wed Mar 25 22:11:36 CST 2020 com/filemaker/util/FMobject.class

This is the unexpected error.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:get (default-cli) on project wrapper: Couldn't download artifact: Unable to get dependency information for filemaker:com.filemaker:jar:19.0.0: Failed to retrieve POM for filemaker:com.filemaker:jar:19.0.0: Could not transfer artifact filemaker:com.filemaker:pom:19.0.0 from/to spring (http://repo.spring.io/plugins-release/): Authorization failed for http://repo.spring.io/plugins-release/filemaker/com.filemaker/19.0.0/com.filemaker-19.0.0.pom 403 Forbidden
[ERROR]   filemaker:com.filemaker:jar:19.0.0
[ERROR] 
[ERROR] from the specified remote repositories:
[ERROR]   spring (http://repo.spring.io/plugins-release/, releases=true, snapshots=true),
[ERROR]   central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)
[ERROR] Path to dependency: 
[ERROR]     1) org.apache.maven.plugins:maven-downloader-plugin:jar:1.0
[ERROR] 
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
csmu-cenr commented 3 years ago

Discovered the pom.xml can't have dependencies with the project structure.

New pom.xml extract.

        <dependency>
            <groupId>com.filemaker</groupId>
            <artifactId>jdbc</artifactId>
            <version>19.0.0</version>
            <scope>system</scope>
            <systemPath>/Library/Java/Extensions/fmjdbc.jar</systemPath>
        </dependency>

Same error as above.

elliots commented 3 years ago

It's been a while since I used maven much, but I seem to remember you can install a jar into the local repository, then reference it using group/artifact/version.

Not super pretty, but it would at least get you past it.

mvn install:install-file -Dfile=/Library/Java/Extensions/fmjdbc.jar -DgroupId=com.filemaker -DartifactId=jdbc -Dversion=19.0.0
csmu-cenr commented 3 years ago

Cheers and thanks @elliots

That worked!