- Navigate in a browser to https://mvnrepository.com/
- Identify your library. (Enter the library name or a related topic into the search box. Then select it by clicking on it.)
- On the library's page you have to click on the particular version you want.
- On the version page there is a table row named Files which contains the links to the .pom and .jar files.
A Java application to download a file from an URL:
import java.io.*; import java.net.*; import java.nio.file.*;
public class Download {
public static void main(String[] args) throws MalformedURLException, IOException{
String url = args[0];
String fileName = url.substring(url.lastIndexOf('/') + 1, url.length());
try(InputStream in = new URL(args[0]).openStream()) {
Files.copy(in, Paths.get(fileName), StandardCopyOption.REPLACE_EXISTING);
}
}
}
$ java Download.java https://repo1.maven.org/maven2/org/xerial/sqlite-jdbc/3.36.0.3/sqlite-jdbc-3.36.0.3.jar
$ ls sqlite-jdbc-3.36.0.3.jar
sqlite-jdbc-3.36.0.3.jar
$
Other than Java everything else works as fine for the download, i.e. download via your browser or via a command line tool like curl
:
$ curl https://repo1.maven.org/maven2/org/json/json/20220320/json-20220320.jar --output json-20220320.jar
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 70939 100 70939 0 0 339k 0 --:--:-- --:--:-- --:--:-- 348k
jar
link on a typical Maven page such as this one. I don't know why you would want to do this, or how useful it would be, without its transitive dependencies... You may end up just writing your own "Maven-Lite" app.