简体   繁体   English

Maven发布JAR

[英]Maven release JAR

How can i make a project jar release and maven repository strucuture(md5hash,distribution pom,etc) to put this in my own repository? 我如何制作项目jar版本和Maven存储库结构(md5hash,distribution pom等)以将其放入自己的存储库中? Maven have a plugin to do it? Maven有插件可以做到吗? Note, i need to generate this structure in my local machine, i don't have CI and others to do it! 请注意,我需要在本地计算机上生成此结构,我没有CI和其他人可以这样做!

Hopes!!! 希望!

Check the deploy plugin , I think this is what you're looking for. 检查一下deploy插件 ,我认为这就是您想要的。 Quoting the documentation: 引用文档:

As a repository contains more than the artifacts (POMs, the metadata, MD5 and SHA1 hash files...), deploying means not only copying the artifacts, but making sure all this information is correctly updated. 由于存储库包含的工件(POM,元数据,MD5和SHA1哈希文件...)不仅仅包含工件,因此部署意味着不仅要复制工件,还要确保正确地更新了所有这些信息。 It's the reponsibility of the deploy plugin. 这是deploy插件的责任。

You'll need to declare a <distributionManagement> element to use it, something like this: 您需要声明一个<distributionManagement>元素才能使用它,如下所示:

  <distributionManagement>
    <repository>
      <id>internal.repo</id>
      <name>MyCo Internal Repository</name>
      <url>Host to Company Repository</url>
    </repository>
  </distributionManagement>

Where the url can be a "local" file:// . 网址可以是“本地” file://

And if the question is about installing a (third party) jar in your local repository (the question is not totally clear), have look at the Maven Install Plugin, install:install and install:install-file both admit a createChecksum optional parameters. 如果问题是关于在本地存储库中安装(第三方)jar(问题尚不完全清楚),请查看Maven安装插件, install:installinstall:install-file都接受createChecksum可选参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM