-
-
Save cccaternberg/ff25c4a39c9f0ff874def6541b3229e8 to your computer and use it in GitHub Desktop.
Artifact upload to nexus using curl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nexus 2.x | |
# Assuming you run this command against the directory the jar sits in | |
# | |
# r - repository | |
# hasPom - whether you are supplying the pom or you want one generated. If generated g, a, v, p, and c are not needed | |
# e - extension | |
# g - group id | |
# a - artifact id | |
# v - version | |
# p - packaging | |
# c - classifier (optional, not shown in examples above) | |
# file - the file(s) to be uploaded. These need to come last, and if there is a pom file it should come before the artifact | |
curl -v -F r=yourrepo -F hasPom=false -F e=jar -F g=yourgroup -F a=yourartifact -F v=yourversion -F c=yourclassifier -F p=jar -F file=@./your-jar-file-1.0.jar -u admin:admin123 http://192.168.99.100:32768/service/local/artifact/maven/content | |
# nexus 3.x | |
# in settings.xml | |
#<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | |
# xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
# xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 | |
# https://maven.apache.org/xsd/settings-1.0.0.xsd"> | |
# <servers> | |
# <!--your existing servers are here if any--> | |
# <server> | |
# <id>nexus</id> | |
# <username>admin</username> | |
# <password>admin123</password> | |
# </server> | |
# </servers> | |
#</settings> | |
mvn deploy:deploy-file -DgroupId=eam -DartifactId=ant-contrib -Dversion=1.0b3 -DgeneratePom=true -Dpackaging=jar -DrepositoryId=nexus -Durl=http://localhost:8081/repository/thirdparty -Dfile=ant-contrib-1.0b3.jar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
curl -v -u :
--upload-file artifact.zip
https:///repository/maven-releases/com/example/artifact/1.0.0/artifact-1.0.0.zip