How to install jar in maven local repository using mvn command.
Unable to download artifact / jar on maven repo ? Here is how to maven-install jar to local repository example.

All you have to do to install jar locally is to execute below maven command.
Example
mvn install:install-file -Dfile="C:\avi\work\poc\GWT\gwt-sl-1.7.jar" -DgroupId=net.sf.gwtwidget -DartifactId=gwt-sl -Dversion=1.7 -Dpackaging=jar
where:
mvn install:install-file
-Dfile=path-to-jar-file
-DgroupId=artifact-group-id
-DartifactId=artifact-id
-Dversion=artifact-version
-Dpackaging=jar
C:\Users\Avi>mvn install:install-file -Dfile="C:\avi\work\poc\GWT\gwt-sl-1.7.jar" -DgroupId=net.sf.gwt-widget -DartifactId=gwt-sl -Dversion=1.7 -Dpackaging=jar` [INFO] Scanning for projects... Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5 [INFO] [INFO] ------------------< org.apache.maven:standalone-pom >------------------- [INFO] Building Maven Stub Project (No POM) 1 [INFO] --------------------------------[ pom ]--------------------------------- [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5 [INFO] [INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom --- [INFO] Installing C:\avi\work\poc\GWT\gwt-sl-1.7.jar to C:\Users\avi\.m2\repository\net\sf\gwt-widget\gwt-sl\1.7\gwt-sl-1.7.jar` [INFO] Installing C:\Users\avi\AppData\Local\Temp\mvninstall2408646245728831919.pom to C:\Users\798582\.m2\repository\net\sf\gwt-widget\gwt-sl\1.7\gwt-sl-1.7.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.857 s [INFO] Finished at: 2021-05-26T17:09:08+05:30 [INFO] ------------------------------------------------------------------------
Read Next :
- Java is not recognized
- IntellijIdea Installation guide
- Java Reserved vs Contextual Keywords
- Java ERROR code 1603
- Java Update on Mac
- Java Update check fails
- Java wont install on windows 10
- Java installation error code 80
- Windows does not recognize java
- Access Adobe programs Java
- Failed to install java update
- System breaks jdk8 javac command
- Java Uninstall Stops at Progress Bar
- Could not find java dll
- Eclipse Error code 13
- Java Uninstall Stops at Progress Bar
- JDBC Connection Exception
Archives
- Java is not recognized
- IntellijIdea Installation guide
- Java Reserved vs Contextual Keywords
- Java ERROR code 1603
- Java Update on Mac
- Java Update check fails
- Java wont install on windows 10
- Java installation error code 80
- Windows does not recognize java
- Access Adobe programs Java
- Failed to install java update
- System breaks jdk8 javac command
- Java Uninstall Stops at Progress Bar
- Could not find java dll
- Eclipse Error code 13
- JDBC Connection Exception