How to add\\install to maven dependency of newly c

2019-06-08 19:41发布

问题:

For a maven project a Jar file needed for my code but which is not in maven repository so, I have downloaded and added the jar file in configured remote repository.

I want to add dependency of the jar. so i would like to know

<groupId>?</groupId>
<artifactId>?</artifactId>
<version>?</version>

Also i like to know where i can find these details in the jar

回答1:

You need to install this JAR into your own repository, see this official tutorial.

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

Now include this installed artifact into your project as a regular dependency.