gpt4 book ai didi

java - Maven 命名约定 32 位与 64 位以及 Windows 与 Linux

转载 作者:搜寻专家 更新时间:2023-10-31 20:21:45 24 4
gpt4 key购买 nike

我有一个有 4 个不同版本的库:32 位和 64 位 Windows 以及 32 位和 64 位 Linux。在将它们上传到 Maven 存储库时,我试图找出每个库的名称。现在我有:

  <!--windows 32bit -->
<groupId>com.lib-name.win</groupId>
<artifactId>lib-name</artifactId>
<classifier>x86<classifier>
<version>10</version>

<!--windows 64bit -->
<groupId>com.lib-name.win</groupId>
<artifactId>lib-name</artifactId>
<classifier>x86-64<classifier>
<version>10</version>

<!--linux 32bit -->
<groupId>com.lib-name.nix</groupId>
<artifactId>lib-name</artifactId>
<classifier>x86<classifier>
<version>10</version>

<!--linux 64bit -->
<groupId>com.lib-name.nix</groupId>
<artifactId>lib-name</artifactId>
<classifier>x86-64<classifier>
<version>10</version>

对于这种情况,是否有更标准的方法在 Maven 中为 jar 命名?还是我在正确的轨道上?

最佳答案

来自 http://maven.apache.org/pom.html :

classifier: The classifier allows to distinguish artifacts that were built from the same POM but differ in their content. It is some optional and arbitrary string that - if present - is appended to the artifact name just after the version number.

As a motivation for this element, consider for example a project that offers an artifact targeting JRE 1.5 but at the same time also an artifact that still supports JRE 1.4. The first artifact could be equipped with the classifier jdk15 and the second one with jdk14 such that clients can choose which one to use.

后一段表明他们打算让分类器执行您想到的那种任务。

但是,根据我的经验,我遇到的大多数项目都会为项目的每个脉络发布单独的 Artifact 。我个人更喜欢这种方法,但这是个人喜好问题。

关于java - Maven 命名约定 32 位与 64 位以及 Windows 与 Linux,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13822407/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com