开发者

How can I create local Maven repository for my own libraries?

开发者 https://www.devze.com 2023-03-31 09:37 出处:网络
I need to have my own libraries in Maven repository, and I only need these my own libraries (about 2-7 libs). Is it possible to开发者_JS百科 copy these jars to some local folder and then use that as r

I need to have my own libraries in Maven repository, and I only need these my own libraries (about 2-7 libs). Is it possible to开发者_JS百科 copy these jars to some local folder and then use that as repository in Maven?


Assuming these libraries only need to be available for your local build, you can just install them in to your repo from the cmd line:

mvn install:install-file -DgroupId=<your_group_name> -DartifactId=<your_artifact_name> -Dversion=<snapshot> -Dfile=<path_to_your_jar_file> -Dpackaging=jar -DgeneratePom=true

You can use any artefact/group/version you likr - but these then need to be used in your pom when listing the dependency

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号