- [Cameron] Hey, I'm Cameron McKenzie.
I'm the editor-in-chief over at TheServerSide.com,
and I wanted to talk to you a little bit about
making Artifactory your local Maven repository.
So I'm over at the JFrog page,
I'm at the open source page,
and I wanna install Artifactory
which means first downloading the ZIP file.
Now, I've actually done a little bit of tomfoolery here,
I've already downloaded it,
so I can probably click cancel on that download.
There it is in all 95 megs of its glory.
It looks like we've got Nexus there as well.
I'm gonna focus on Artifactory
and I'm just gonna extract that ZIP file,
and inside that ZIP file there is some Artifactory goodness
with the bin directory and everything,
and really this represents the entire
Artifactory local Maven repository.
I'm gonna rename this file, just for a second.
I always like doing this.
I'm gonna put an underscore at the beginning
and take off all of that trailing information on it.
So I'm gonna take that Artifactory file,
I'm just gonna copy it to the C drive,
and I'm gonna open up a DOS prompt
and I'm gonna move into the bin directory of Artifactory.
And now, I'm gonna actually start Artifactory,
but I have a feeling that I might
actually get a memory error.
So let's take a look, and it does.
It says it can't reserve enough space and memory
on the heap for this object.
That's not uncommon,
especially if you're on a virtual machine.
That's just solved by going into
the Artifactory's bin directory
and editing that batch file.
Should have a couple of options in there,
edit with Notepad,
and I think we've got XMS, XMS,
we've got this using up two gigs here.
I don't think that's necessary
so I'll use 1024 instead.
Click save,
and then go back in here and try and rerun the application.
And as you can see, it's no problem.
We're gonna not allocate two gigs of memory to Artifactory,
and once done, everything should start up.
And now it looks like Artifactory is successfully installed,
that means it's time to go and log in.
So localhost
8081 should do it.
That will redirect us to Artifactory's web app,
and when we get here, we'll probably wanna log in
so we've got access
to all of the neat features of Artifactory.
And so, username is just admin,
password is just password.
We log in and we get this really handsome design.
Lots of interesting things here,
a little bit of a push
to go to some of their professional products,
but we don't have to be tempted by that.
And once I'm in Artifactory,
the next thing I wanna do is just do a quick setup,
so there's a quick setup option right there.
It says, "Hey, do you wanna create a basic repository
for Gradle or Ivy or Maven?"
And Maven is the one that I'm actually interested in,
so I'll highlight that, click Create,
and now you'll notice that Artifactory
has created the local snapshot
and the local release repositories for me.
If I click Finish,
go over, take a look at my actual repositories,
and you'll see I've got a whole bunch
of different items there.
And the one that I'm interested in right now
is the local release database.
And so let's say I wanna actually just deploy
a JAR file to this.
Now, there's a variety of ways you can deploy a JAR file,
but one of them is manually.
And I've actually got a little repository here
on my file system.
It's called mavenspiration
for all of our inspired Maven stuff,
and that's actually just available over on GitHub.
And you can see it's mavenspiration there,
and not too much that's interesting about that.
The only thing that's interesting is just one Java file,
nothing crazy there,
and a POM file, of course,
that's got my grav in there,
the groupId, the artifactId and the version.
That may come in handy in a moment,
so I'll leave that open.
And also, I've done a build in this folder,
so I've actually got my JAR file,
maven-tutorial-1.0.1.jar
based on, obviously,
what was in the POM file over here.
And I actually wanna move this into Artifactory,
so here I go, I've got the libs-release-local.
I want to deploy to that so I click on the Deploy button.
It says, "Hey, just drop your file here,"
so that looks pretty easy.
I'll take my Maven tutorial file,
I'll drop it into that directory.
Take a look at what other information it wants.
It's found the group ID, found the artifact ID,
found the version.
It noticed that it's a JAR file and there's no classifier.
I like that, I'm gonna click Deploy.
It has successfully deployed this particular JAR file,
and now if I look at the libs release repository,
there it is,
and you can find it right under that release local folder.
And I can even go down here and it gives me
reference and dependency information
for including this in the Maven build,
an Ivy build,
even a Gradle build and sbt build as well.
And there you go, that's all there is to it.
It's fairly straightforward.
Easy to download, easy to install,
and easy to upload a JAR file to that Maven repository.
Now, in subsequent tutorials, we'll take it a bit further.
We may incorporate this into a Jenkins deployment,
we may do a manual upload
from a Maven build file,
but getting started, being able to download,
install, configure,
and upload a JAR file to JFrog Artifactory,
well, that's a pretty good accomplishment
for the first tutorial here.