How to download and install the jar in my local Maven repo

I am trying to download jar for the internal repository using tomcat and then install it in the local Maven repository.

The jar file is located under path:http://10.11.250.14/strepo/ext/JSErrorCollector-0.2.jar .

I am editing my pom.xml by providing a link to the internal repository, and also adding a dependency to pom.xml , but maven cannot load the jar.

 <repositories> <repository> <id>internal.repo</id> <url>http://10.11.250.14/strepo/ext/</url> </repository> </repositories> <dependencies> <dependency> <groupId>org.JS</groupId> <artifactId>JSErrorCollector</artifactId> <version>0.2</version> </dependency> 

could you help me?

+6
source share
1 answer

This is not just a jar just for creating a Maven repository, there are a bunch of other things to consider as a Maven repository. At the url, I think this is not a standard Maven repository layout.

Thus, you have at least 2 options:

  1. Set up your own local Maven network repository using Artifactory , Nexus, or other similar software systems.
  2. Download the file and add it to the repository of your local computer.

For option 2, just upload the file, and then run the Maven mvn command as follows (assuming the file is in your current directory):

 mvn install:install-file -Dfile=JSErrorCollector-0.2.jar -DgroupId=strepo.ext -DartifactId=JSErrorCollector -Dversion=0.2 -Dpackaging=jar 

After that, you can access this with:

 <dependency> <groupId>strepo.ext</groupId> <artifactId>JSErrorCollector</artifactId> <version>0.2</version> </dependency> 
+8
source

Source: https://habr.com/ru/post/1439546/


All Articles