java – maven命名约定32 vs 64位和windows vs linux

我有一个有4个不同版本的库:32位和64位窗口以及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中的罐子命名?还是我走在正确的轨道上?

最佳答案 从
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.

后一段建议他们打算使用分类器来执行您想到的任务.

但是,根据我的经验,我遇到的大多数项目都会为项目的每个静脉发布单独的工件.我个人更喜欢这种方法,但这是一个品味问题.

点赞