0

I'm new to nexus. using nexus 3. I managed to created and push docker images into nexus. Now I would like to upload simple files into nexus.

To which repository type should I push file to? (I managed to upload via GUI into "maven-release" repository) What is the command to upload file from Linux machine?

I tried variations of this command but failed:

curl -v -u MyUser:ThePassword --upload-file /tmp/LIAV2/pinokyo http://NEXUSIP:8081/repository/maven-releases/aa/bb/cc

I also tried maven command, and failed. E.G:

mvn deploy:deploy-file -DgroupId=aa \
    -DartifactId=bb \
    -Dversion=cc \
    -Dpackaging=jar \
    -Dfile=foo.jar \
    -DgeneratePom=true \
    -DrepositoryId=my-repo \
    -Durl=http://NEXUSIP:8081/repository/maven-releases/

This is how the file, loaded from gui, looks like

and third question, can I see the content of a file uploaded? My final goal is load a *.war file, but I'd like to know if I can see content

Thanks in advance :-)

Liav
  • 65
  • 3
  • 9

1 Answers1

1

Found the solution. Writing it here, hopefully it will help some else :-)

Q: To which repository type should I push file to?

A: raw (hosted)

Q: What is the command to upload file from Linux machine?

A: create repository called my-raw-repo of type hosted via nexus GUI

create a file

echo "abcd" > /tmp/LIAV2/pinokyo

upload file :

curl --fail -u myuser:PWD --upload-file /tmp/LIAV2/pinokyo 'http://NEXUSIP:8081/repository/my-raw-repo/'

see via nexus GUI file is in there

verify upload

delete file

rm /tmp/LIAV2/pinokyo

download file :

wget --user=myuser --password=PWD "http://NEXUSIP:8081/repository/my-raw-repo/pinokyo"

verify content

cat /tmp/LIAV2/pinokyo

Q: can I see the content of a file uploaded?

A: from nexus go the the repository to HTML view. Press on file.

Liav
  • 65
  • 3
  • 9