Nexus 2.x had a REST API to download artifacts like below based on some Maven GAV co-ordinates but this no longer works for Nexus 3.x
wget "http://local:8081/service/local/artifact/maven/redirect?g=com.mycompany&a=my-app&v=LATEST" --content-disposition
or
curl --insecure "https://local:8081/service/local/artifact/maven/content?r=public&g=log4j&a=log4j&v=1.2.17&p=jar&c=" > log4j.jar
workaround in 2 steps now, require maven in path
echo '<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.acme</groupId>
<artifactId>any</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<groupId></groupId>
<artifactId></artifactId>
<version></version>
<type></type>
<classifier></classifier>
<destFileName></destFileName>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>copy</id>
<phase>process-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
<type>${type}</type>
<classifier>${classifier}</classifier>
<overWrite>true</overWrite>
<outputDirectory>.</outputDirectory>
<destFileName>${destFileName}</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>' > getDependency.xml
mvn -f getDependency.xml process-resources \
-DgroupId=log4j -DartifactId=log4j -Dversion=1.2.17 \
-Dtype=jar -Dclassifier= -DdestFileName=log4j.xml