Skip to content

Instantly share code, notes, and snippets.

@donnfelker
Created September 21, 2011 19:25
Show Gist options
  • Save donnfelker/1233044 to your computer and use it in GitHub Desktop.
Save donnfelker/1233044 to your computer and use it in GitHub Desktop.
Maven Third Party Repo
# This will create a pom, md5 and sha1 for the jar and pom in your ~/.m2/ directory.
# here i'm installing the FlurryAgent from my /tmp/ directory
mvn install:install-file -Dfile=/tmp/FlurryAgent.jar -DgroupId=com.flurry -DartifactId=FlurryAgent -Dversion=2.2 -Dpackaging=jar -DcreatePom=true -DcreateChecksum=true
# Copy this entire folder from your ~/.m2/ folder
# Place it into your third.party.closed.source repo (local repo checked into source control)
# In your applications pom file, add a third party repo
# This assumes the apps is at the same level as the 3rd party repo (see below for folder structure)
<repository>
<id>third.party.closed.source.repo</id>
<url>file://${basedir}/../maven_repo_3rd_party</url>
</repository>
# Then check in the third party repo into your source control
# This is not optimal, but it will prevent all of your team members
# from having to manually install this file.
# example source control folder structure
/--
/maven_repo_3rd_party
/YourAppName
# Now, when you run "maven clean install" maven will find the jar in the local 3rd party repo.
# When you check it in to your source control repo, you'll all then have access to it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment