Maven: How to create assembly with snapshot artifacts without timestamps file name?

后端 未结 2 2024
梦如初夏
梦如初夏 2021-01-31 11:43

I\'ve a repository containing snapshot artifacts with timestamps.

I want to create an assembly, that contains the dependencies. This works fine. But the artifact names c

2条回答
  •  后悔当初
    2021-01-31 12:18

    Could you try the following for the outputFileNameMapping:

    ${artifactId}-${baseVersion}.${extension}
    

    According to issues like MASSEMBLY-67, MASSEMBLY-91:

    Using ${baseVersion} for cases where you want to preserve the -SNAPSHOT naming, the plugin retains the ability to use ${version} for the timestamp-buildnumber naming, which is useful for describing the exact library version included in the assembly.

    Update: After feedback from the OP, the exact syntax is (wasn't totally sure of this):

    ${artifact.artifactId}-${artifact.baseVersion}.${artifact.extension}
    

提交回复
热议问题