Eric
Eric

Reputation: 673

Use Maven Library without Drinking Maven Koolaid

I want to use the diffplug/Durian library, but do not want to use Maven. Is there a way to use a Maven library without using Maven itself in a project?

Upvotes: 1

Views: 106

Answers (2)

Eric
Eric

Reputation: 673

I found that IntelliJ IDEA allows for exporting of a Maven module to a JAR, that can be used in non-Maven projects.

https://www.jetbrains.com/help/idea/2016.1/downloading-libraries-from-maven-repositories.html

And needed to know what a "Maven Coordinate" was. I found it for the library in question at https://mvnrepository.com/artifact/com.diffplug.durian/durian/3.4.0, and it is the string "com.diffplug.durian:durian:3.4.0".

Basically, follow Project Structure->Project Settings->Libraries->"+"->New Project Library->From Maven. The resultant dialog takes a Maven coordinate, and has a "Download To" option, that will make a nice JAR at the specified location, from the Maven library you import. Can add source and javadocs as well. After doing the download, you navigate to the system folder containing the new JAR, and stick it in your real non-Maven project (an Eclipse project, in my case).

Upvotes: 1

Eric Nord
Eric Nord

Reputation: 4885

This has a link to the .jar and lists it's dependencies. http://mvnrepository.com/artifact/com.diffplug.durian/durian/3.4.0

Download the jar - then all the jar's dependencies and their dependencies and add them to the class path.

Upvotes: 1

Related Questions