Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Alcar32/6106019 to your computer and use it in GitHub Desktop.

Select an option

Save Alcar32/6106019 to your computer and use it in GitHub Desktop.
[HowTo] | [Maven] How to create a local maven repository stored in a maven project and import a jar file in this local repository.
# Example if a jar file called 'maryclient.jar' is stored in 'lib' folder in project root.
# The parameter of '-Durl' need a full path name to local repository
$> mvn deploy:deploy-file -Dfile=".\lib\maryclient.jar" -DgroupId=de.mary.dfki -DartifactId=maryclient -Dversion=1.0 -Dpackaging=jar -Durl="file://C:\Users\domann\workspace\juno\SmartNutritionAssistant\CookingAssistant\repo"
# After the import is finished. The project structure should be like this:
project
|
+--src
| |
| +--main
| |
| +--java
| |
| +...
|
+--lib
| |
| +--maryclient.jar
|
+--repo
|
+--de
|
+--mary
|
+--dfki
|
+--maryclient
|
+--1.0
|
+--maryclient-1.0.jar
|
+--maryclient-1.0.pom
for more information see:
http://maven.apache.org/plugins/maven-deploy-plugin/usage.html
</build>
...
</build>
<repositories>
<repository>
<id>jars</id>
<!-- has to be a url linked to file system. A folder 'repo' must exist in the project root (${project.basedir})-->
<url>file://${project.basedir}/repo</url>
</repository>
</repositories>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment