Yesterday, I got a task to integrate some artifacts into one piece using Nexus. I’ve never done it before, so it was a bit of a head-scratcher at first, I will share my experience from zero to hero.
The Beginning
At first, I started by searching on Google, after reading some articles about it, I got a general idea of what I should do.
I kicked things off by firing up Nexus. Luckily, it was already installed on our server, so I didn’t have to mess with that.
Creating the Repository
First thing’s first,I needed a place to stash all these pieces. So, I went ahead and created a new “raw (hosted)” repository in Nexus. I gave it a simple name like “one-piece-repo”. The “hosted” part just means Nexus is managing it directly, not just proxying something from somewhere else.
Uploading the Artifacts
Next up, I had a bunch of files – JARs, some config files, you name it – that needed to be part of this “one piece”. I used the Nexus web UI to upload these. It was pretty straightforward, like attaching files to an email. I just selected the files, hit “upload”, and boom, they were in the repository.
Figuring out the structure
Now, I had all my files in Nexus, but they were just kind of dumped in there. I needed some organization. I decided to create a simple directory structure within the repository. This is kind of like putting things in folders on your computer. For example, I made a “lib” folder for the JARs and a “config” folder for the configuration files.
- libs
- configs
Testing the setup
To test everything, download files from my new structure in Nexus to see, everthing is okey!
Wrapping Up
And that’s pretty much it! I took a bunch of separate files, uploaded them to Nexus, organized them a bit, and now they’re all in one place, ready to be used. It wasn’t rocket science, but it definitely made things more organized. I call it “one piece” just because it makes it sound cooler than it is.