OneBusAway / onebusaway

Parent module for all OneBusAway projects with common configuration information.
https://github.com/OneBusAway/onebusaway/wiki
Other
336 stars 72 forks source link

Add new SQL Server JDBC driver artifact versions to OBA Maven repo #11

Closed barbeau closed 7 years ago

barbeau commented 7 years ago

Looks like we're keeping an artifact for the Microsoft SQL Server JDBC driver in our OBA Maven repo, which is nice because it's not available via Maven Central.

If I run mvn install for this project, which uses the onebusaway-gtfs artifact and this dependency:

        <dependency>
            <groupId>com.microsoft.sqlserver</groupId>
            <artifactId>sqljdbc4</artifactId>
            <version>4.0</version>
        </dependency>

I can see the SQL Server JDBC driver artifact 4.0 being pulled down:

...
Downloading: http://nexus.onebusaway.org/content/groups/public/com/microsoft/sqlserver/sqljdbc4/4.0/sqljdbc4-4.0.pom
...
Downloaded: http://nexus.onebusaway.org/content/groups/public/com/microsoft/sqlserver/sqljdbc4/4.0/sqljdbc4-4.0.jar (525 KB at 493.1 KB/sec)
...

However, it looks like versions 4.1, 4.2, and 6.0 are now available at Microsoft's site (https://www.microsoft.com/en-us/download/details.aspx?id=11774), but aren't yet installed in the OBA Maven repo.

4.2 adds JDK 8 support, and 6.0 includes some security/encryption enhancements.

Command to install a version such as 4.2 should be:

mvn install:install-file -Dfile=sqljdbc4.jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.2 -Dpackaging=jar

@sheldonabrown Would you be able to add the artifacts for versions 4.1, 4.2, and 6.0 to the OBA Maven repo?

sheldonabrown commented 7 years ago

A couple of things:

1) install is for local dependencies, you want deploy for remote dependencies. Something like this;

mvn deploy:deploy-file -Durl=http://nexus.onebusaway.org/content/repositories/releases/ -DrepositoryId=nexus.onebusaway.org-releases -DgeneratePom=true -Dfile=sqljdbc_4.2/enu/sqljdbc41.jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.1 -Dpackaging=jar

2) Microsoft doesn't make it easy. Version 6 is actually an update of version 4.1 and 4.2, and not labelled 6.0:

sqljdbc_6.0/enu/sqljdbc.jar
sqljdbc_6.0/enu/sqljdbc4.jar
sqljdbc_6.0/enu/sqljdbc41.jar
sqljdbc_6.0/enu/sqljdbc42.jar

From release.txt:

JAR Files:
---------
To support backward compatibility and possible upgrade scenarios, the JDBC Driver 6.0 includes
four JAR class libraries in each installation package: sqljdbc.jar, sqljdbc4.jar, sqljdbc41.jar,
and sqljdbc42.jar.

Important Note: sqljdbc.jar and sqljdbc4.jar are provided only for backwards compatibility, and do
not contain the new features included with this release.  Only sqljdbc41.jar and sqljdbc42.jar
contain the new features.

This presents a problem for maven versioning. To solve this I arbitrarily decided to change the artifact id to sqljdbc6:

http://nexus.onebusaway.org/nexus/content/repositories/releases/com/microsoft/sqlserver/sqljdbc6/

I think that's the best way to handle this. Let me know if you have other ideas.

Sheldon

barbeau commented 7 years ago

@sheldonabrown Thanks! I think that should work fine.