0

I want to use a maven plugin. The problem here is I could not connect to the internet. So I want to save this in my local and install it. So I have used maven install command and in that i have given my local file path. But still it is connecting to https://repo.maven.org site. and showing timed out error. I want to install two plugins jfree library and pdfngreporter. Can someone help me to install this to my local repository without connecting to internet??

1 Answers1

0

in your setting.xml set <offline>true</offline>

offline: true if this build system should operate in offline mode, defaults to false. This element is useful for build servers which cannot connect to a remote repository, either because of network setup or security reasons.

Install that jar before running offline: Follow this simple steps

mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \
    -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>

for your jar : Download that jar on some path say c:\

Run following command:

mvn install:install-file -Dfile=c:\Excelreportgenerato.jar -DgroupId=com.xls.report
        -DartifactId=TestNgToExcel -Dversion=4.0.1 -Dpackaging=jar

More details here

VedantK
  • 9,728
  • 7
  • 66
  • 71
  • Thank you so much. But still it is showing as some jars are missing. I have downloaded the jars from maven repository and trying to install it. Now it is showing as the pom for org.codehaus.plexus-utils:jar 3.0.5 is missing – Ashwini Jan 27 '18 at 09:36
  • you first run with online mode. Reason: All your jars from central repo will get downloaded. If not able to run online than you need to download each jar from mvn repo and drop in .m2 folder – VedantK Jan 27 '18 at 09:38
  • Actually I could not run in online mode. The problem here is the proxy I'm using is not taken by maven, when I put this in settings file. But it is working fine to browse through IE or chrome. Is there any way to allow maven to use the browser proxy settings ? – Ashwini Jan 27 '18 at 09:47
  • you are accesing from any organisatoin network? may be they dont allow to connect?this might help https://stackoverflow.com/questions/1251192/how-do-i-use-maven-through-a-proxy – VedantK Jan 27 '18 at 09:51
  • Yes.. actually now we are migrating to a new virtual machine. I have copied the entire m2 repository from my old machine to the new one. Except this pdf plugin everything is working fine.. – Ashwini Jan 27 '18 at 10:10
  • can you name this pdf plugin – VedantK Jan 27 '18 at 13:36