Malt
Malt

Reputation: 30335

How to add an external jar that's not published on Maven central to a gradle project

Microsoft doesn't publish its Sql Server jdbc drivers in Maven central; they're only available as a download form msdn.

With Maven, one possible solution was to install the missing jar in Maven's local repository, but that has to be done separately on each machine, and it wouldn't work with a Gradle build that doesn't use the local Maven repository.

Is there a convenient way of placing the jar in the company's central artifactory repo?

Upvotes: 2

Views: 528

Answers (1)

Malt
Malt

Reputation: 30335

Here's how to do it in artifactory 4.0.2:

Go to the "Artifacts" menu on the left, and click on "Deploy". enter image description here

Pick "ext-release-local", and drag the jar into the box.

Fill in the regular Maven artifact details - group id (e.g. com.microsoft.sqlserver), artifact id (e.g. sqljdbc4) and version (e.g. 4.2) and click on "Deploy Jar's Internal POM/Generate Default POM"

enter image description here

That's it! The jar should be available from artifactory with the group id, artifact id, and version you entered:

dependencies {
    compile group: 'com.microsoft.sqlserver', name: 'sqljdbc4', version: '4.2'
}

Upvotes: 1

Related Questions